Skip to content

Commit 617534b

Browse files
authored
chore: replace PAT token with GitHub App token (#179)
Replace secrets.PAT_TOKEN with a short-lived token generated by the agentcore-devx-automation GitHub App (ID: 3637953) via actions/create-github-app-token@v1. This improves security by using ephemeral tokens scoped to the installation rather than long-lived personal access tokens. Requires adding repo variable APP_ID=3637953 and repo secret APP_PRIVATE_KEY with the app's RSA private key.
1 parent 8c1db84 commit 617534b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/agent-restricted.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ jobs:
6666
6767
- uses: actions/checkout@v6
6868

69+
- name: Generate GitHub App Token
70+
id: app-token
71+
uses: actions/create-github-app-token@v1
72+
with:
73+
app-id: ${{ vars.APP_ID }}
74+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
75+
6976
- name: Run Strands Agent
7077
uses: ./.github/actions/strands-action
7178
with:
@@ -78,6 +85,6 @@ jobs:
7885
agent_runner: ${{ inputs.agent_runner }}
7986
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
8087
aws_region: 'us-west-2'
81-
pat_token: ${{ secrets.PAT_TOKEN }}
88+
pat_token: ${{ steps.app-token.outputs.token }}
8289
env:
8390
STRANDS_TOOLS_DIRECTORY: 'true'

0 commit comments

Comments
 (0)