Skip to content

Commit 134c5a3

Browse files
committed
fix: Replace GIT_ACCESS_TOKEN with GitHub App token
Use actions/create-github-app-token@v1 instead of the GIT_ACCESS_TOKEN secret.
1 parent e61c4f4 commit 134c5a3

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/claude-code-dependency-review.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ on:
1515
CLOUD_ML_REGION:
1616
required: true
1717
description: GCP region for Vertex AI
18-
GIT_ACCESS_TOKEN:
18+
ACTIONS_APP_PRIVATE_KEY:
1919
required: false
20-
description: Token for accessing private Git repositories in the same org
20+
description: Private key for the GitHub App used to access private repositories
2121

2222
jobs:
2323
dependency-review:
@@ -35,13 +35,21 @@ jobs:
3535
ref: ${{ github.event.pull_request.head.sha }}
3636
fetch-depth: 1
3737

38+
- name: Generate token for private repositories
39+
if: secrets.ACTIONS_APP_PRIVATE_KEY != ''
40+
uses: actions/create-github-app-token@v1
41+
id: app-token
42+
with:
43+
app-id: ${{ vars.ACTIONS_APP_ID }}
44+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
45+
owner: ${{ github.repository_owner }}
46+
3847
- name: Configure git for private repositories
48+
if: steps.app-token.outputs.token != ''
3949
run: |
40-
if [ -n "$GIT_ACCESS_TOKEN" ]; then
41-
git config --global url."https://x-access-token:${GIT_ACCESS_TOKEN}@github.com/".insteadOf "https://github.com/"
42-
fi
50+
git config --global url."https://x-access-token:${GIT_ACCESS_TOKEN}@github.com/".insteadOf "https://github.com/"
4351
env:
44-
GIT_ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
52+
GIT_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
4553

4654
- name: Install dependencies
4755
id: install-deps

0 commit comments

Comments
 (0)