fix: use GitHub App token for auto-merge workflow

Generate GitHub App token using GH_DOCS_SYNC_APP_ID and GH_DOCS_SYNC_APP_PRIVATE_KEY secrets. Use the app token instead of GITHUB_TOKEN for both close-superseded and auto-merge steps to ensure downstream workflow triggers (sdk_publish.yaml) after merge. This aligns token usage with typescript-sdk and go-sdk implementations.
This commit is contained in:
Christine Chen
2026-06-23 17:59:16 -04:00
parent ddcadce542
commit 60add6da49
@@ -31,9 +31,16 @@ jobs:
)
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.GH_DOCS_SYNC_APP_ID }}
private-key: ${{ secrets.GH_DOCS_SYNC_APP_PRIVATE_KEY }}
- name: Close superseded Speakeasy PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
set -euo pipefail
CURRENT_PR="${{ github.event.pull_request.number }}"
@@ -64,7 +71,7 @@ jobs:
- name: Auto-merge Speakeasy PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
set -euo pipefail
PR_NUM="${{ github.event.pull_request.number }}"