Skip to content

Commit 3125d8b

Browse files
authored
fix(ci): use apps.getAuthenticated() for GitHub App tokens (#27)
The workflow was failing with "Resource not accessible by integration" because GitHub App tokens cannot access the /user endpoint. That endpoint is only available for OAuth tokens. Changed to use apps.getAuthenticated() which returns the app information and works correctly with GitHub App tokens. Assisted-by: Claude Code (Sonnet 4.5) Signed-off-by: Colin Walters <[email protected]>
1 parent e905f34 commit 3125d8b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/sync-common.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ jobs:
103103
with:
104104
github-token: ${{ steps.token.outputs.token }}
105105
script: |
106-
const user = await github.rest.users.getAuthenticated();
107-
console.log('Bot user:', user.data);
108-
core.setOutput('name', user.data.login);
109-
core.setOutput('email', `${user.data.id}+${user.data.login}@users.noreply.github.com`);
106+
const app = await github.rest.apps.getAuthenticated();
107+
console.log('Bot app:', app.data);
108+
const botName = `${app.data.slug}[bot]`;
109+
const botEmail = `${app.data.id}+${app.data.slug}[bot]@users.noreply.github.com`;
110+
core.setOutput('name', botName);
111+
core.setOutput('email', botEmail);
110112
111113
- name: Sync common files to repository
112114
run: |

0 commit comments

Comments
 (0)