mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-07 20:35:33 -04:00
Compare commits
3 Commits
a1f3d9ecd4
...
1815c3c880
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1815c3c880 | ||
![]() |
10fc07a79b | ||
![]() |
db9fc17071 |
@ -8,6 +8,10 @@ permissions:
|
|||||||
checks: write
|
checks: write
|
||||||
contents: read
|
contents: read
|
||||||
actions: write
|
actions: write
|
||||||
|
packages: read
|
||||||
|
pull-requests: write
|
||||||
|
statuses: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GKE_ZONE: 'us-central1'
|
GKE_ZONE: 'us-central1'
|
||||||
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
@ -224,6 +224,29 @@ export class RemoteClient {
|
|||||||
if (!CloudRunner.buildParameters.skipLfs) {
|
if (!CloudRunner.buildParameters.skipLfs) {
|
||||||
try {
|
try {
|
||||||
RemoteClientLogger.log(`Attempting to pull LFS files with GIT_PRIVATE_TOKEN...`);
|
RemoteClientLogger.log(`Attempting to pull LFS files with GIT_PRIVATE_TOKEN...`);
|
||||||
|
|
||||||
|
// Configure git to use GIT_PRIVATE_TOKEN
|
||||||
|
const gitPrivateToken = process.env.GIT_PRIVATE_TOKEN;
|
||||||
|
if (!gitPrivateToken) {
|
||||||
|
throw new Error('GIT_PRIVATE_TOKEN is not available');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear any existing URL configurations
|
||||||
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf`);
|
||||||
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf`);
|
||||||
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf`);
|
||||||
|
|
||||||
|
// Set new URL configuration with token
|
||||||
|
await CloudRunnerSystem.Run(
|
||||||
|
`git config --global url."https://${gitPrivateToken}@github.com/".insteadOf "https://github.com/"`,
|
||||||
|
);
|
||||||
|
await CloudRunnerSystem.Run(
|
||||||
|
`git config --global url."https://${gitPrivateToken}@github.com/".insteadOf "ssh://git@github.com/"`,
|
||||||
|
);
|
||||||
|
await CloudRunnerSystem.Run(
|
||||||
|
`git config --global url."https://${gitPrivateToken}@github.com/".insteadOf "git@github.com"`,
|
||||||
|
);
|
||||||
|
|
||||||
await CloudRunnerSystem.Run(`git lfs pull`);
|
await CloudRunnerSystem.Run(`git lfs pull`);
|
||||||
RemoteClientLogger.log(`Successfully pulled LFS files with GIT_PRIVATE_TOKEN`);
|
RemoteClientLogger.log(`Successfully pulled LFS files with GIT_PRIVATE_TOKEN`);
|
||||||
assert(fs.existsSync(CloudRunnerFolders.lfsFolderAbsolute));
|
assert(fs.existsSync(CloudRunnerFolders.lfsFolderAbsolute));
|
||||||
@ -238,15 +261,20 @@ export class RemoteClient {
|
|||||||
throw new Error('GITHUB_TOKEN is not available as fallback');
|
throw new Error('GITHUB_TOKEN is not available as fallback');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure git to use GITHUB_TOKEN
|
// Clear any existing URL configurations
|
||||||
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."https://github.com/".insteadOf`);
|
||||||
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."ssh://git@github.com/".insteadOf`);
|
||||||
|
await CloudRunnerSystem.Run(`git config --global --unset-all url."git@github.com".insteadOf`);
|
||||||
|
|
||||||
|
// Set new URL configuration with token
|
||||||
await CloudRunnerSystem.Run(
|
await CloudRunnerSystem.Run(
|
||||||
`git config --global --replace-all url."https://token:${githubToken}@github.com/".insteadOf ssh://git@github.com/`,
|
`git config --global url."https://${githubToken}@github.com/".insteadOf "https://github.com/"`,
|
||||||
);
|
);
|
||||||
await CloudRunnerSystem.Run(
|
await CloudRunnerSystem.Run(
|
||||||
`git config --global --add url."https://token:${githubToken}@github.com/".insteadOf git@github.com`,
|
`git config --global url."https://${githubToken}@github.com/".insteadOf "ssh://git@github.com/"`,
|
||||||
);
|
);
|
||||||
await CloudRunnerSystem.Run(
|
await CloudRunnerSystem.Run(
|
||||||
`git config --global --add url."https://token:${githubToken}@github.com/".insteadOf "https://github.com/"`,
|
`git config --global url."https://${githubToken}@github.com/".insteadOf "git@github.com"`,
|
||||||
);
|
);
|
||||||
|
|
||||||
await CloudRunnerSystem.Run(`git lfs pull`);
|
await CloudRunnerSystem.Run(`git lfs pull`);
|
||||||
|
Loading…
Reference in New Issue
Block a user