Skip to content

fix: re-enable Speakeasy auto-merge with GitHub App auth#489

Merged
christineschen merged 1 commit into
mainfrom
fix/auto-merge-resilience
Jun 23, 2026
Merged

fix: re-enable Speakeasy auto-merge with GitHub App auth#489
christineschen merged 1 commit into
mainfrom
fix/auto-merge-resilience

Conversation

@christineschen

@christineschen christineschen commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Re-enables Speakeasy auto-merge (disabled on main pending SDK-466 / PAT fix)
  • Replaces GH_TOKEN fine-grained PAT with short-lived GH_DOCS_SYNC GitHub App tokens (actions/create-github-app-token@v3), matching openrouter-web #25517
  • Retries branch_name extraction for up to 2 minutes while Generate job logs propagate
  • Passes run_started_at through resolve-branch job output (with API fallback)
  • Migrates dispatch-agent-bump.yaml to the same app token for cross-repo dispatch

Prerequisites

  • GH_DOCS_SYNC_APP_ID and GH_DOCS_SYNC_APP_PRIVATE_KEY added to typescript-sdk repo secrets (already exist in openrouter-web)
  • GH_DOCS_SYNC app has Contents + Pull requests write on typescript-sdk, and dispatch access on typescript-agent

Test plan

  • Merge this PR
  • Dispatch Generate on main
  • Confirm resolve-branch logs Extracted branch_name=... (attempt N)
  • Confirm auto-merge resolves and squash-merges the regen PR (not "auto-merge disabled")
  • Confirm Publish runs after merge
  • After next npm publish, confirm Dispatch Agent Bump reaches typescript-agent

perry-the-pr-reviewer[bot]

This comment was marked as outdated.

@christineschen christineschen force-pushed the fix/auto-merge-resilience branch from a6b90a8 to 2bbea42 Compare June 22, 2026 16:57
@christineschen christineschen changed the title fix: harden Speakeasy auto-merge against log delay and PAT rejection fix: re-enable Speakeasy auto-merge with GitHub App auth Jun 22, 2026
perry-the-pr-reviewer[bot]

This comment was marked as outdated.

Replace GH_TOKEN PAT (blocked by enterprise 366-day policy) with short-lived
GH_DOCS_SYNC app tokens, matching openrouter-web #25517. Re-enables auto-merge
disabled on main (SDK-466), retries branch_name log extraction, and passes
run_started_at via resolve-branch job output.
@christineschen christineschen force-pushed the fix/auto-merge-resilience branch from 2bbea42 to 5f58e60 Compare June 23, 2026 21:58

@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.

Perry's Review

Re-enables the Speakeasy auto-merge automation by replacing the PAT (gh_token) with a GH_DOCS_SYNC GitHub App token across the auto-merge, agent-dispatch, and both SDK-generation workflows, and threads run_started_at through resolve-branch with a log-readiness retry loop.

Verdict: 💬 Comments / questions

Details

Risk: 🟡 Medium — CI/CD config only (Speakeasy regen automation); reversible by rollback, fast-detect via Actions, no committed secrets.

CI: all passing ✅

Findings (one standing item, already tracked inline — not re-posted):

  • 🟡 The run_started_at API fallback in both generation workflows still uses a malformed gh invocation (the jq raw flag is swallowed as the jq expression, hard-failing the resolve-branch step under set -euo pipefail on exactly the empty-run_started_at fallback this PR adds). Two of my prior review threads at a6b90a8 flag this and remain unresolved — re-affirmed against this head; the offending lines are unchanged. Dropping that stray flag (the gh jq flag is already raw) fixes it; the repo's own state lookup nearby uses the correct form.

Verified at source:

  • Both reusable-workflow callers updated in lockstep; resolve-branch job + output wiring correct; auto-merge consumes resolve-branch.outputs.run_started_at.
  • GH_DOCS_SYNC_APP_ID / GH_DOCS_SYNC_APP_PRIVATE_KEY secret names consistent across all four workflows and the create-github-app-token@v3 step inputs; dispatch-agent-bump scopes the token to typescript-agent.
  • Auto-merge body (PR resolution, supersede-close, squash/auto-merge, wait_for_checks) is a verbatim un-comment of the previously-disabled block, now driven by the App token; the contents:write / pull-requests:write permissions cover the merge/close operations.

Security: GitHub App credential handling (attacker class: supply-chain) — App ID + private key are referenced via secrets only; no literal credential added in the diff. Net improvement over the prior PAT.

Test coverage: N/A — GitHub Actions workflow config; exercised only by the live Speakeasy generate→merge pipeline.

Unresolved threads: 2 (both Perry-authored, same standing run_started_at fallback finding above).

Scope: incremental re-review (prior reviewed SHA on record; no diff snapshot) — standing finding re-affirmed, no net-new findings
Review: tier=medium · model=claude-opus-latest · score=4.8

@christineschen christineschen merged commit a3c28a8 into main Jun 23, 2026
1 check passed
@christineschen christineschen deleted the fix/auto-merge-resilience 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