Skip to content

fix: use GitHub App token for auto-merge workflow#355

Merged
christineschen merged 2 commits into
mainfrom
fix/update-auto-merge-token
Jun 23, 2026
Merged

fix: use GitHub App token for auto-merge workflow#355
christineschen merged 2 commits into
mainfrom
fix/update-auto-merge-token

Conversation

@christineschen

Copy link
Copy Markdown
Collaborator

Summary

Update the auto-merge workflow to use a GitHub App token instead of GITHUB_TOKEN to ensure downstream workflow triggers (sdk_publish.yaml) after merge.

Changes

  • 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
  • Ensures sdk_publish.yaml workflow is triggered after automatic merge
  • Aligns token usage with typescript-sdk and go-sdk implementations

Rationale

Using GITHUB_TOKEN prevents downstream workflow triggers because GitHub Actions intentionally blocks workflow chains initiated by actions tokens for security. Using a GitHub App token bypasses this limitation while maintaining security through properly scoped app permissions.

Verification

This pattern is already successfully used in:

  • OpenRouterTeam/typescript-sdk/.github/workflows/auto-merge-speakeasy-pr.yaml
  • OpenRouterTeam/go-sdk/.github/workflows/auto-merge-speakeasy-pr.yaml

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.
perry-the-pr-reviewer[bot]

This comment was marked as outdated.

Pin actions/create-github-app-token to v3.2.0 commit SHA (bcd2ba49...) instead of mutable @V3 tag to prevent supply chain attacks where a compromised account could force-push malicious code to the tag. This eliminates the risk of secret leakage and malicious code execution in CI workflows.

@perry-the-pr-reviewer perry-the-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ APPROVE unavailable on this installation — the maintainer GitHub App is not
configured, so the verdict below is posted as COMMENT. Event-level approval
(for branch-protection / review requirements) must be added out-of-band.

Perry's Review

Pins actions/create-github-app-token from mutable @v3 semver to the immutable SHA bcd2ba492... (v3.2.0), and replaces GITHUB_TOKEN with the GitHub App token in both the close-superseded and auto-merge workflow steps — enabling downstream workflow triggering after merge.

Verdict: ✅ LGTM

Details

Risk: 🟢 Low — security hardening only; no auth gate removed, no data changed

CI: 0 checks (no CI configured on this PR)

Findings: none

Codex: skipped (trivial tier)

Research: skipped (trivial tier)

Security: SHA pin (bcd2ba49...) verified accurate for actions/create-github-app-token@v3.2.0 — supply-chain risk from prior round addressed. GH_DOCS_SYNC_APP_PRIVATE_KEY passed to a SHA-pinned action (no mutable tag exposure). Categories 1+7 touched; safeguards intact.

Test coverage: no tests for GHA workflow logic — expected

Unresolved threads: 1 outdated Perry thread from prior round (SHA pin suggestion, now implemented)

Scope: incremental — 2 new lines since prior review (comment + SHA pin)
Review: tier=trivial · model=claude-sonnet-latest · score=0.1

@christineschen christineschen merged commit c8bf74a into main Jun 23, 2026
@christineschen christineschen deleted the fix/update-auto-merge-token branch June 23, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant