github: workflowRunURL

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2024-02-04 11:08:41 +01:00
parent 26949f5f39
commit 11cc7c697d
No known key found for this signature in database
GPG key ID: ADE44D8C9D44FBE4
4 changed files with 14 additions and 9 deletions

View file

@ -49,6 +49,10 @@ export class GitHub {
return process.env.GITHUB_API_URL || 'https://api.github.com';
}
static get workflowRunURL(): string {
return `${GitHub.serverURL}/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.context.runId}`;
}
static get actionsRuntimeToken(): GitHubActionsRuntimeToken | undefined {
const token = process.env['ACTIONS_RUNTIME_TOKEN'] || '';
return token ? (jwtDecode<JwtPayload>(token) as GitHubActionsRuntimeToken) : undefined;