Skip to content

Commit 589120f

Browse files
authored
Merge pull request #185 from vue-pivottable/develop
chore: test JWT generation
2 parents 5a2684f + ea94d45 commit 589120f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,32 @@ jobs:
1717
pull-requests: write
1818
id-token: write
1919
steps:
20+
- name: Test JWT Generation
21+
run: |
22+
npm install -g jsonwebtoken
23+
node -e "
24+
const jwt = require('jsonwebtoken');
25+
const privateKey = process.env.PRIVATE_KEY;
26+
const appId = process.env.APP_ID;
27+
28+
try {
29+
const now = Math.floor(Date.now() / 1000);
30+
const payload = {
31+
iat: now - 60,
32+
exp: now + 600,
33+
iss: appId
34+
};
35+
const token = jwt.sign(payload, privateKey, { algorithm: 'RS256' });
36+
console.log('✓ JWT generated successfully');
37+
console.log('Token length:', token.length);
38+
} catch (error) {
39+
console.error('✗ JWT generation failed:', error.message);
40+
}
41+
"
42+
env:
43+
APP_ID: ${{ secrets.APP_ID }}
44+
PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
45+
2046
- name: Generate GitHub App Token
2147
id: generate-token
2248
uses: actions/create-github-app-token@v2

0 commit comments

Comments
 (0)