Compare commits

..

2 Commits

Author SHA1 Message Date
Philipp Mildenberger
2b399b2641 Add gitPrivateToken support again (#377) 2022-04-05 17:46:52 +02:00
David Finol
40891d6b43 Fix mac builds (#376) 2022-04-04 10:19:40 +02:00
5 changed files with 13 additions and 9 deletions

8
dist/index.js generated vendored
View File

@@ -3291,7 +3291,7 @@ class Docker {
});
}
static getLinuxCommand(image, parameters) {
const { workspace, actionFolder, runnerTempPath, sshAgent } = parameters;
const { workspace, actionFolder, runnerTempPath, sshAgent, gitPrivateToken } = parameters;
const githubHome = path_1.default.join(runnerTempPath, '_github_home');
if (!fs_1.existsSync(githubHome))
fs_1.mkdirSync(githubHome);
@@ -3304,6 +3304,7 @@ class Docker {
${image_environment_factory_1.default.getEnvVarString(parameters)} \
--env UNITY_SERIAL \
--env GITHUB_WORKSPACE=/github/workspace \
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "${githubHome}":"/root:z" \
--volume "${githubWorkflow}":"/github/workflow:z" \
@@ -3317,13 +3318,14 @@ class Docker {
/bin/bash -c /entrypoint.sh`;
}
static getWindowsCommand(image, parameters) {
const { workspace, actionFolder, unitySerial } = parameters;
const { workspace, actionFolder, unitySerial, gitPrivateToken } = parameters;
return `docker run \
--workdir /github/workspace \
--rm \
${image_environment_factory_1.default.getEnvVarString(parameters)} \
--env UNITY_SERIAL="${unitySerial}" \
--env GITHUB_WORKSPACE=c:/github/workspace \
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
--volume "${workspace}":"c:/github/workspace" \
--volume "c:/regkeys":"c:/regkeys" \
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
@@ -3505,7 +3507,7 @@ class ImageTag {
case 'linux':
return 'ubuntu';
default:
throw new Error('The Operating System of this runner is not yet supported.');
return '';
}
}
static getTargetPlatformToTargetPlatformSuffixMap(platform, version) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -7,8 +7,8 @@ else
echo "GIT_PRIVATE_TOKEN is set configuring git credentials"
git config --global credential.helper store
git config --global --replace-all url.https://github.com/.insteadOf ssh://git@github.com/
git config --global --add url.https://github.com/.insteadOf git@github.com
git config --global --replace-all url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf ssh://git@github.com/
git config --global --add url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf git@github.com
git config --global url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "https://github.com/"
git config --global url."https://ssh:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "ssh://git@github.com/"

View File

@@ -17,7 +17,7 @@ class Docker {
}
static getLinuxCommand(image, parameters): string {
const { workspace, actionFolder, runnerTempPath, sshAgent } = parameters;
const { workspace, actionFolder, runnerTempPath, sshAgent, gitPrivateToken } = parameters;
const githubHome = path.join(runnerTempPath, '_github_home');
if (!existsSync(githubHome)) mkdirSync(githubHome);
@@ -30,6 +30,7 @@ class Docker {
${ImageEnvironmentFactory.getEnvVarString(parameters)} \
--env UNITY_SERIAL \
--env GITHUB_WORKSPACE=/github/workspace \
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "${githubHome}":"/root:z" \
--volume "${githubWorkflow}":"/github/workflow:z" \
@@ -44,13 +45,14 @@ class Docker {
}
static getWindowsCommand(image: any, parameters: any): string {
const { workspace, actionFolder, unitySerial } = parameters;
const { workspace, actionFolder, unitySerial, gitPrivateToken } = parameters;
return `docker run \
--workdir /github/workspace \
--rm \
${ImageEnvironmentFactory.getEnvVarString(parameters)} \
--env UNITY_SERIAL="${unitySerial}" \
--env GITHUB_WORKSPACE=c:/github/workspace \
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
--volume "${workspace}":"c:/github/workspace" \
--volume "c:/regkeys":"c:/regkeys" \
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \

View File

@@ -60,7 +60,7 @@ class ImageTag {
case 'linux':
return 'ubuntu';
default:
throw new Error('The Operating System of this runner is not yet supported.');
return '';
}
}