move caching folder fix

pull/310/head
Frostebite 2022-01-23 19:26:13 +00:00
parent f2ef0b73c9
commit f4eccf6a32
6 changed files with 93 additions and 105 deletions

176
dist/index.js vendored
View File

@ -333,10 +333,10 @@ class Cache {
if (action_1.default.isRunningLocally) { if (action_1.default.isRunningLocally) {
return; return;
} }
core.warning(` core.warning(`
Library folder does not exist. Library folder does not exist.
Consider setting up caching to speed up your workflow, Consider setting up caching to speed up your workflow,
if this is not your first build. if this is not your first build.
`); `);
} }
} }
@ -482,8 +482,8 @@ class CLI {
static runRemoteClientJob() { static runRemoteClientJob() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}'); const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
remote_client_logger_1.RemoteClientLogger.log(`Build Params: remote_client_logger_1.RemoteClientLogger.log(`Build Params:
${JSON.stringify(buildParameter, undefined, 4)} ${JSON.stringify(buildParameter, undefined, 4)}
`); `);
cloud_runner_state_1.CloudRunnerState.setup(buildParameter); cloud_runner_state_1.CloudRunnerState.setup(buildParameter);
yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run(); yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run();
@ -635,7 +635,7 @@ class Caching {
fs_1.default.createReadStream(`${cacheSelection}.zip`).pipe(unzipper_1.default.Extract({ path: resultsDirectory })); fs_1.default.createReadStream(`${cacheSelection}.zip`).pipe(unzipper_1.default.Extract({ path: resultsDirectory }));
remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullDestination}`); remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullDestination}`);
console_1.assert(`${fs_1.default.existsSync(fullDestination)}`); console_1.assert(`${fs_1.default.existsSync(fullDestination)}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv -v "${fullDestination}/*" "${destinationFolder}"`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv -v "${fullDestination}/" "${destinationFolder}"`);
fs_1.default.rmdirSync(fullDestination); fs_1.default.rmdirSync(fullDestination);
} }
else { else {
@ -700,7 +700,9 @@ class CloudRunnerSystem {
throw error; throw error;
} }
if (stderr) { if (stderr) {
remote_client_logger_1.RemoteClientLogger.logCliDiagnostic(`${stderr.toString()}`); const diagnosticOutput = `${stderr.toString()}`;
remote_client_logger_1.RemoteClientLogger.logCliDiagnostic(diagnosticOutput);
output += diagnosticOutput;
return; return;
} }
const outputChunk = `${stdout}`; const outputChunk = `${stdout}`;
@ -1492,25 +1494,25 @@ exports.AWSTemplates = void 0;
const fs = __importStar(__webpack_require__(35747)); const fs = __importStar(__webpack_require__(35747));
class AWSTemplates { class AWSTemplates {
static getParameterTemplate(p1) { static getParameterTemplate(p1) {
return ` return `
${p1}: ${p1}:
Type: String Type: String
Default: '' Default: ''
`; `;
} }
static getSecretTemplate(p1) { static getSecretTemplate(p1) {
return ` return `
${p1}Secret: ${p1}Secret:
Type: AWS::SecretsManager::Secret Type: AWS::SecretsManager::Secret
Properties: Properties:
Name: '${p1}' Name: '${p1}'
SecretString: !Ref ${p1} SecretString: !Ref ${p1}
`; `;
} }
static getSecretDefinitionTemplate(p1, p2) { static getSecretDefinitionTemplate(p1, p2) {
return ` return `
- Name: '${p1}' - Name: '${p1}'
ValueFrom: !Ref ${p2}Secret ValueFrom: !Ref ${p2}Secret
`; `;
} }
static insertAtTemplate(template, insertionKey, insertion) { static insertAtTemplate(template, insertionKey, insertion) {
@ -2117,8 +2119,8 @@ class KubernetesJobSpecFactory {
command: [ command: [
'bin/bash', 'bin/bash',
'-c', '-c',
`cd /data/builder/action/steps; `cd /data/builder/action/steps;
chmod +x /return_license.sh; chmod +x /return_license.sh;
/return_license.sh;`, /return_license.sh;`,
], ],
}, },
@ -2530,15 +2532,15 @@ const yaml_1 = __importDefault(__webpack_require__(13552));
class CloudRunnerBuildCommandProcessor { class CloudRunnerBuildCommandProcessor {
static ProcessCommands(commands, buildParameters) { static ProcessCommands(commands, buildParameters) {
const hooks = CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`all`)); const hooks = CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`all`));
return `echo "---" return `echo "---"
echo "start cloud runner init" echo "start cloud runner init"
${__1.Input.cloudRunnerTests ? '' : '#'} printenv ${__1.Input.cloudRunnerTests ? '' : '#'} printenv
echo "start cloud runner job" echo "start cloud runner job"
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '} ${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
${commands} ${commands}
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '} ${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
echo "end of cloud runner job echo "end of cloud runner job
---${buildParameters.logId}" ---${buildParameters.logId}"
`; `;
} }
static getHooks() { static getHooks() {
@ -2874,35 +2876,35 @@ class BuildStep {
cloud_runner_logger_1.default.logLine(` `); cloud_runner_logger_1.default.logLine(` `);
cloud_runner_logger_1.default.logLine('Starting part 2/2 (build unity project)'); cloud_runner_logger_1.default.logLine('Starting part 2/2 (build unity project)');
const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`)); const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`));
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '} return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GITHUB_WORKSPACE="${cloud_runner_state_1.CloudRunnerState.repoPathFull}" export GITHUB_WORKSPACE="${cloud_runner_state_1.CloudRunnerState.repoPathFull}"
cp -r "${path_1.default cp -r "${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'default-build-script') .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'default-build-script')
.replace(/\\/g, `/`)}" "/UnityBuilderAction" .replace(/\\/g, `/`)}" "/UnityBuilderAction"
cp -r "${path_1.default cp -r "${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh') .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh')
.replace(/\\/g, `/`)}" "/entrypoint.sh" .replace(/\\/g, `/`)}" "/entrypoint.sh"
cp -r "${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'steps').replace(/\\/g, `/`)}" "/steps" cp -r "${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'steps').replace(/\\/g, `/`)}" "/steps"
chmod -R +x "/entrypoint.sh" chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps" chmod -R +x "/steps"
/entrypoint.sh /entrypoint.sh
apt-get update apt-get update
apt-get install -y -q zip tree apt-get install -y -q zip tree
cd "${cloud_runner_state_1.CloudRunnerState.libraryFolderFull.replace(/\\/g, `/`)}/.." cd "${cloud_runner_state_1.CloudRunnerState.libraryFolderFull.replace(/\\/g, `/`)}/.."
zip -r "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "Library" zip -r "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "Library"
mv "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library" mv "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library"
cd "${cloud_runner_state_1.CloudRunnerState.repoPathFull.replace(/\\/g, `/`)}" cd "${cloud_runner_state_1.CloudRunnerState.repoPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
zip -r "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "build" zip -r "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "build"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}" ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
mv "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}" mv "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default node ${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`) .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`)
.replace(/\\/g, `/`)} -m cache-push "Library" "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library" .replace(/\\/g, `/`)} -m cache-push "Library" "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}" ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}"
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '} ${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.projectPathFull}`, environmentVariables, secrets); `, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.projectPathFull}`, environmentVariables, secrets);
}); });
} }
@ -2953,16 +2955,16 @@ class SetupStep {
cloud_runner_logger_1.default.log(` `); cloud_runner_logger_1.default.log(` `);
cloud_runner_logger_1.default.logLine('Starting step 1/2 (setup game files from repository)'); cloud_runner_logger_1.default.logLine('Starting step 1/2 (setup game files from repository)');
const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`)); const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`));
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `apk update -q return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `apk update -q
apk add git-lfs jq tree nodejs -q apk add git-lfs jq tree nodejs -q
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '} ${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)} mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}" git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)} ${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '} ${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets); `, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets);
} }
catch (error) { catch (error) {
@ -3219,9 +3221,9 @@ class Docker {
const { path, dockerfile, baseImage } = buildParameters; const { path, dockerfile, baseImage } = buildParameters;
const { version, platform } = baseImage; const { version, platform } = baseImage;
const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform }); const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });
const command = `docker build ${path} \ const command = `docker build ${path} \
--file ${dockerfile} \ --file ${dockerfile} \
--build-arg IMAGE=${baseImage} \ --build-arg IMAGE=${baseImage} \
--tag ${tag}`; --tag ${tag}`;
yield exec_1.exec(command, undefined, { silent }); yield exec_1.exec(command, undefined, { silent });
return tag; return tag;
@ -3230,16 +3232,16 @@ class Docker {
static run(image, parameters, silent = false) { static run(image, parameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const { workspace, runnerTempPath, sshAgent } = parameters; const { workspace, runnerTempPath, sshAgent } = parameters;
const command = `docker run \ const command = `docker run \
--workdir /github/workspace \ --workdir /github/workspace \
--rm \ --rm \
${image_environment_factory_1.default.getEnvVarString(parameters)} \ ${image_environment_factory_1.default.getEnvVarString(parameters)} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \ --volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "${runnerTempPath}/_github_home":"/root" \ --volume "${runnerTempPath}/_github_home":"/root" \
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \ --volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
--volume "${workspace}":"/github/workspace" \ --volume "${workspace}":"/github/workspace" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \ ${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \ ${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
${image}`; ${image}`;
yield exec_1.exec(command, undefined, { silent }); yield exec_1.exec(command, undefined, { silent });
}); });
@ -3564,13 +3566,14 @@ exports.GitRepoReader = void 0;
const console_1 = __webpack_require__(57082); const console_1 = __webpack_require__(57082);
const system_1 = __importDefault(__webpack_require__(62177)); const system_1 = __importDefault(__webpack_require__(62177));
const fs_1 = __importDefault(__webpack_require__(35747)); const fs_1 = __importDefault(__webpack_require__(35747));
const cloud_runner_system_1 = __webpack_require__(66879);
class GitRepoReader { class GitRepoReader {
static GetSha() { static GetSha() {
return ''; return '';
} }
static GetRemote() { static GetRemote() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
return (yield system_1.default.run(`git remote -v`, [], {}, false)) return (yield cloud_runner_system_1.CloudRunnerSystem.Run(`git remote -v`))
.split(' ')[1] .split(' ')[1]
.split('https://github.com/')[1] .split('https://github.com/')[1]
.split('.git')[0]; .split('.git')[0];
@ -3602,24 +3605,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GithubCliReader = void 0; exports.GithubCliReader = void 0;
const system_1 = __importDefault(__webpack_require__(62177)); const cloud_runner_system_1 = __webpack_require__(66879);
class GithubCliReader { class GithubCliReader {
static GetGitHubAuthToken() { static GetGitHubAuthToken() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { return (yield cloud_runner_system_1.CloudRunnerSystem.Run(`gh auth status -t`)).split(`Token: `)[1].replace(/ /g, '').replace(/\n/g, '');
return (yield system_1.default.run(`gh auth status -t`, [], {}, false))
.split(`Token: `)[1]
.replace(/ /g, '')
.replace(/\n/g, '');
}
catch (_a) {
return '';
}
}); });
} }
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -108,7 +108,7 @@ export class Caching {
fs.createReadStream(`${cacheSelection}.zip`).pipe(unzipper.Extract({ path: resultsDirectory })); fs.createReadStream(`${cacheSelection}.zip`).pipe(unzipper.Extract({ path: resultsDirectory }));
RemoteClientLogger.log(`cache item extracted to ${fullDestination}`); RemoteClientLogger.log(`cache item extracted to ${fullDestination}`);
assert(`${fs.existsSync(fullDestination)}`); assert(`${fs.existsSync(fullDestination)}`);
await CloudRunnerSystem.Run(`mv -v "${fullDestination}/*" "${destinationFolder}"`); await CloudRunnerSystem.Run(`mv -v "${fullDestination}/" "${destinationFolder}"`);
fs.rmdirSync(fullDestination); fs.rmdirSync(fullDestination);
} else { } else {
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);

View File

@ -14,7 +14,9 @@ export class CloudRunnerSystem {
throw error; throw error;
} }
if (stderr) { if (stderr) {
RemoteClientLogger.logCliDiagnostic(`${stderr.toString()}`); const diagnosticOutput = `${stderr.toString()}`;
RemoteClientLogger.logCliDiagnostic(diagnosticOutput);
output += diagnosticOutput;
return; return;
} }
const outputChunk = `${stdout}`; const outputChunk = `${stdout}`;

View File

@ -1,13 +1,14 @@
import { assert } from 'console'; import { assert } from 'console';
import System from '../system'; import System from '../system';
import fs from 'fs'; import fs from 'fs';
import { CloudRunnerSystem } from '../cli/remote-client/remote-client-services/cloud-runner-system';
export class GitRepoReader { export class GitRepoReader {
static GetSha() { static GetSha() {
return ''; return '';
} }
public static async GetRemote() { public static async GetRemote() {
return (await System.run(`git remote -v`, [], {}, false)) return (await CloudRunnerSystem.Run(`git remote -v`))
.split(' ')[1] .split(' ')[1]
.split('https://github.com/')[1] .split('https://github.com/')[1]
.split('.git')[0]; .split('.git')[0];

View File

@ -1,14 +1,7 @@
import System from '../system'; import { CloudRunnerSystem } from '../cli/remote-client/remote-client-services/cloud-runner-system';
export class GithubCliReader { export class GithubCliReader {
static async GetGitHubAuthToken() { static async GetGitHubAuthToken() {
try { return (await CloudRunnerSystem.Run(`gh auth status -t`)).split(`Token: `)[1].replace(/ /g, '').replace(/\n/g, '');
return (await System.run(`gh auth status -t`, [], {}, false))
.split(`Token: `)[1]
.replace(/ /g, '')
.replace(/\n/g, '');
} catch {
return '';
}
} }
} }