Skip to content

Commit 73d9315

Browse files
committed
chore: change to gihub app auth
1 parent 81a1ad0 commit 73d9315

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/external-test.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,33 @@ jobs:
9999
echo "result=failure" >> $GITHUB_OUTPUT
100100
fi
101101
102+
- name: Generate GitHub App token
103+
id: generate-token
104+
uses: actions/github-script@v7
105+
with:
106+
script: |
107+
const { createAppAuth } = require('@octokit/auth-app');
108+
109+
const appId = '${{ secrets.APP_ID }}';
110+
const privateKey = `${{ secrets.APP_PRIVATE_KEY }}`;
111+
const installationId = '${{ secrets.APP_INSTALLATION_ID }}';
112+
113+
// Create authenticated app instance
114+
const auth = createAppAuth({
115+
appId: appId,
116+
privateKey: privateKey,
117+
installationId: installationId,
118+
});
119+
120+
// Get installation access token
121+
const { token } = await auth({ type: 'installation' });
122+
123+
// Set the token as output
124+
core.setSecret(token);
125+
core.setOutput('token', token);
126+
127+
console.log('Successfully generated installation access token');
128+
102129
- name: Stop Supabase
103130
if: always()
104131
run: supabase stop
@@ -107,7 +134,7 @@ jobs:
107134
if: always()
108135
uses: actions/github-script@v7
109136
with:
110-
github-token: ${{ secrets.GITHUB_TOKEN }}
137+
github-token: ${{ steps.generate-token.outputs.token }}
111138
script: |
112139
const typeCheckResult = '${{ steps.type-check.outputs.result }}' || 'failure';
113140
const unitTestResult = '${{ steps.unit-tests.outputs.result }}' || 'failure';

0 commit comments

Comments
 (0)