Cloud Runner v2 (#310)

This commit is contained in:
Frostebite
2022-02-01 02:31:20 +00:00
committed by GitHub
parent 4e38a84fe7
commit 03ae77dc7c
90 changed files with 162797 additions and 97684 deletions

View File

@@ -0,0 +1,20 @@
import { CloudRunnerSystem } from '../cli/remote-client/remote-client-services/cloud-runner-system';
import * as core from '@actions/core';
export class GithubCliReader {
static async GetGitHubAuthToken() {
try {
const authStatus = await CloudRunnerSystem.Run(`gh auth status`, true);
if (authStatus.includes('You are not logged') || authStatus === '') {
return '';
}
return (await CloudRunnerSystem.Run(`gh auth status -t`))
.split(`Token: `)[1]
.replace(/ /g, '')
.replace(/\n/g, '');
} catch (error: any) {
core.info(error || 'Failed to get github auth token from gh cli');
return '';
}
}
}