File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments