github: fix jwt-decode import and test

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-10-28 02:37:52 +02:00
parent a625c7487f
commit 0e5f8a766a
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ import {GitHub as Octokit} from '@actions/github/lib/utils';
import * as core from '@actions/core';
import * as github from '@actions/github';
import {Context} from '@actions/github/lib/context';
import jwt_decode from 'jwt-decode';
import {jwtDecode, JwtPayload} from 'jwt-decode';
import {GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubRepo} from './types/github';
@ -51,7 +51,7 @@ export class GitHub {
static get actionsRuntimeToken(): GitHubActionsRuntimeToken | undefined {
const token = process.env['ACTIONS_RUNTIME_TOKEN'] || '';
return token ? jwt_decode<GitHubActionsRuntimeToken>(token) : undefined;
return token ? (jwtDecode<JwtPayload>(token) as GitHubActionsRuntimeToken) : undefined;
}
public static async printActionsRuntimeTokenACs() {