github: handle malformed runtime token

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-03 04:37:26 +01:00
parent 3e2548a8ed
commit 7a9a28cd90
2 changed files with 28 additions and 7 deletions

View File

@@ -55,9 +55,15 @@ export class GitHub {
}
public static async printActionsRuntimeTokenACs() {
const jwt = GitHub.actionsRuntimeToken;
let jwt: GitHubActionsRuntimeToken | undefined;
try {
jwt = GitHub.actionsRuntimeToken;
} catch (e) {
core.warning(`Cannot parse Actions Runtime Token: ${e.message}`);
return;
}
if (!jwt) {
core.info(`ACTIONS_RUNTIME_TOKEN not set`);
core.warning(`ACTIONS_RUNTIME_TOKEN not set`);
return;
}
try {