Skip to content

Commit 1a88d99

Browse files
cguldnerclaude
andauthored
Replace PAT with SDK Updater GitHub App (#548)
* Replace PAT with SDK Updater GitHub App for spec update workflow Use AWS OIDC + Secrets Manager to mint GitHub App installation tokens instead of a classic PAT. Add automerge step for spec update PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e3c8267 commit 1a88d99

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

.github/workflows/spec_update.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,34 @@ on:
44
repository_dispatch:
55
types: [spec_update]
66

7-
permissions: # least privilege; PR creation uses the SPEC_UPDATE_TOKEN PAT
7+
permissions:
8+
id-token: write
89
contents: read
910

1011
jobs:
1112
Update:
1213
runs-on: ubuntu-latest
1314
steps:
15+
- name: Configure AWS credentials
16+
uses: aws-actions/configure-aws-credentials@v6
17+
with:
18+
role-to-assume: arn:aws:iam::082972943155:role/oidc-github-dropbox-dropbox-sdk-python-repo
19+
aws-region: us-west-2
20+
21+
- name: Fetch GitHub App credentials from Secrets Manager
22+
uses: aws-actions/aws-secretsmanager-get-secrets@v3
23+
with:
24+
secret-ids: |
25+
SDK_UPDATER,sdk-updater-github-app
26+
parse-json-secrets: true
27+
28+
- name: Generate GitHub App installation token
29+
id: app-token
30+
uses: actions/create-github-app-token@v3
31+
with:
32+
client-id: ${{ env.SDK_UPDATER_CLIENT_ID }}
33+
private-key: ${{ env.SDK_UPDATER_PRIVATE_KEY }}
34+
1435
- uses: actions/checkout@v7
1536
- name: Setup Python environment
1637
uses: actions/setup-python@v6
@@ -64,10 +85,11 @@ jobs:
6485
pip install -r requirements.txt
6586
python generate_base_client.py
6687
- name: Create Pull Request
88+
id: create-pr
6789
uses: peter-evans/create-pull-request@v8
6890
if: steps.git-diff-num.outputs.num-diff != 0
6991
with:
70-
token: ${{ secrets.SPEC_UPDATE_TOKEN }}
92+
token: ${{ steps.app-token.outputs.token }}
7193
commit-message: |
7294
${{ steps.git-diff.outputs.commit}}
7395
branch: ${{ steps.git-branch.outputs.branch }}
@@ -80,3 +102,9 @@ jobs:
80102
owners
81103
maintainers
82104
draft: false
105+
106+
# - name: Enable Pull Request Automerge
107+
# if: steps.create-pr.outputs.pull-request-number
108+
# run: gh pr merge --merge --auto "${{ steps.create-pr.outputs.pull-request-number }}"
109+
# env:
110+
# GH_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)