Skip to content

Commit

Permalink
Merge pull request #196 from docker/dependabot/npm_and_yarn/jwt-decod…
Browse files Browse the repository at this point in the history
…e-4.0.0

build(deps): bump jwt-decode from 3.1.2 to 4.0.0
  • Loading branch information
crazy-max authored Oct 30, 2023
2 parents 7b1a9e4 + 0e5f8a7 commit 243e746
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion __tests__/github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('printActionsRuntimeTokenACs', () => {
});
it('malformed', async () => {
process.env.ACTIONS_RUNTIME_TOKEN = 'foo';
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error("Cannot parse GitHub Actions Runtime Token: Invalid token specified: Cannot read properties of undefined (reading 'replace')"));
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error('Cannot parse GitHub Actions Runtime Token: Invalid token specified: missing part #2'));
});
it('refs/heads/master', async () => {
const infoSpy = jest.spyOn(core, 'info');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"csv-parse": "^5.5.2",
"handlebars": "^4.7.8",
"js-yaml": "^4.1.0",
"jwt-decode": "^3.1.2",
"jwt-decode": "^4.0.0",
"semver": "^7.5.4",
"tmp": "^0.2.1"
},
Expand Down
4 changes: 2 additions & 2 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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() {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ __metadata:
handlebars: ^4.7.8
jest: ^29.6.4
js-yaml: ^4.1.0
jwt-decode: ^3.1.2
jwt-decode: ^4.0.0
prettier: ^3.0.3
rimraf: ^5.0.1
semver: ^7.5.4
Expand Down Expand Up @@ -5356,10 +5356,10 @@ __metadata:
languageName: node
linkType: hard

"jwt-decode@npm:^3.1.2":
version: 3.1.2
resolution: "jwt-decode@npm:3.1.2"
checksum: 20a4b072d44ce3479f42d0d2c8d3dabeb353081ba4982e40b83a779f2459a70be26441be6c160bfc8c3c6eadf9f6380a036fbb06ac5406b5674e35d8c4205eeb
"jwt-decode@npm:^4.0.0":
version: 4.0.0
resolution: "jwt-decode@npm:4.0.0"
checksum: 390e2edcb31a92e86c8cbdd1edeea4c0d62acd371f8a8f0a8878e499390c0ecf4c658b365c4e941e4ef37d0170e4ca650aaa49f99a45c0b9695a235b210154b0
languageName: node
linkType: hard

Expand Down

0 comments on commit 243e746

Please sign in to comment.