Skip to content

fix(ci): use GitHub App token for auto-commits to trigger CI#2871

Merged
amikofalvy merged 1 commit intomainfrom
fix/bot-commits-trigger-ci
Mar 27, 2026
Merged

fix(ci): use GitHub App token for auto-commits to trigger CI#2871
amikofalvy merged 1 commit intomainfrom
fix/bot-commits-trigger-ci

Conversation

@amikofalvy
Copy link
Copy Markdown
Collaborator

Summary

  • Bot commits pushed with the default GITHUB_TOKEN (github-actions[bot]) don't trigger workflow runs — a deliberate GitHub protection against infinite loops
  • This caused PR Preserve part ordering in conversations API #2866 to be stuck for 30 minutes waiting on required CI/Cypress checks that never ran after an OpenAPI snapshot auto-commit
  • Now uses the inkeep-internal-ci GitHub App token (already used in release.yml) for both OpenAPI snapshot commits (ci.yml) and auto-format commits (auto-format.yml)
  • App token commits are attributed to inkeep-internal-ci[bot] which triggers downstream workflow runs

Test plan

  • Push a PR that modifies OpenAPI-affecting files → verify the auto-committed snapshot update triggers CI/Cypress runs on the new HEAD
  • Push a PR with formatting issues → verify the auto-format commit triggers CI runs on the new HEAD
  • Verify INTERNAL_CI_APP_ID and INTERNAL_CI_APP_PRIVATE_KEY secrets are accessible to both workflows

🤖 Generated with Claude Code

Bot commits pushed with the default GITHUB_TOKEN (github-actions[bot])
don't trigger workflow runs due to GitHub's infinite loop protection.
This left PRs stuck waiting for required checks that never ran.

Now uses the inkeep-internal-ci GitHub App token for OpenAPI snapshot
commits (ci.yml) and auto-format commits (auto-format.yml), matching
the pattern already used in release.yml. App token commits trigger
downstream workflows.

Fixes: PR #2866 stuck 30min waiting on CI after OpenAPI snapshot commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: f320486

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Mar 27, 2026 7:16pm
agents-docs Ready Ready Preview, Comment Mar 27, 2026 7:16pm
agents-manage-ui Ready Ready Preview, Comment Mar 27, 2026 7:16pm

Request Review

@amikofalvy amikofalvy enabled auto-merge March 27, 2026 19:14
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Mar 27, 2026

TL;DR — Switches auto-commit steps in CI and auto-format workflows from the default GITHUB_TOKEN to an inkeep-internal-ci GitHub App token so that bot-pushed commits actually trigger downstream CI runs. This fixes a class of stuck PRs where required checks never started after an automated snapshot or formatting commit.

Key changes

  • Generate GitHub App token in auto-format.yml — adds a create-github-app-token step and rewrites the push remote URL to use the App token, so auto-format commits trigger CI.
  • Generate GitHub App token in ci.yml — same pattern for OpenAPI snapshot auto-commits, gated behind non-fork PR conditions.

Summary | 2 files | 1 commit | base: mainfix/bot-commits-trigger-ci


GitHub App token for bot commits

Before: Auto-commits (formatting fixes, OpenAPI snapshot updates) were pushed with the default GITHUB_TOKEN, attributed to github-actions[bot]. GitHub deliberately ignores these commits for workflow triggers to prevent infinite loops — leaving required checks stuck indefinitely.
After: Both workflows generate a token via the inkeep-internal-ci GitHub App using actions/create-github-app-token. The push remote is rewritten to use this token, so commits are attributed to inkeep-internal-ci[bot] and correctly trigger downstream workflows.

The pattern is identical in both files: generate the App token early, pass it as an APP_TOKEN env var to the commit/push step, and conditionally git remote set-url before pushing. The ci.yml token step is additionally gated on non-changeset, non-fork PR conditions to match the existing OpenAPI snapshot guard.

Why not just use a PAT? Personal access tokens work but are tied to individual user accounts and have broader scope. GitHub App tokens are scoped to the repository, short-lived, and auditable — the same reason the release workflow already uses this approach.

.github/workflows/auto-format.yml · .github/workflows/ci.yml

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

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

Clean, well-scoped fix. The root cause analysis is correct — GITHUB_TOKEN commits deliberately don't trigger workflows to prevent infinite loops, and using a GitHub App token is the standard workaround.

Verified:

  • The create-github-app-token action pin (d72941d797fd3113feb6b93fd0dec494b13a2547) matches the existing usage across release.yml, claude.yml, model-sync.yml, etc.
  • The if [ -n "$APP_TOKEN" ] guard before git remote set-url is a good defensive pattern — degrades gracefully if the token step is skipped or fails.
  • ci.yml correctly gates the token generation to pull_request events from the same repo (not forks), matching the existing fork guard on the OpenAPI snapshot steps.
  • auto-format.yml doesn't need the fork check since the job-level if already skips fork PRs entirely.
  • Checkout steps correctly continue using GITHUB_TOKEN (read-only access is sufficient); the app token is only used for the push where it matters.

No issues found.

Pullfrog  | View workflow run | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(0) Total Issues | Risk: Low

Analysis

This PR correctly addresses the issue where auto-commits using the default GITHUB_TOKEN don't trigger downstream CI workflows (a deliberate GitHub protection against infinite loops). The solution uses the inkeep-internal-ci GitHub App token, which is already established across multiple workflows in this repository.

Key observations:

  1. Consistency with existing patterns ✅ — The implementation matches the exact pattern used in release.yml, claude.yml, claude-code-review.yml, model-sync.yml, and closed-pr-review-auto-improver.yml:

    • Same action pinned to the same commit hash (d72941d797fd3113feb6b93fd0dec494b13a2547)
    • Same secrets (INTERNAL_CI_APP_ID, INTERNAL_CI_APP_PRIVATE_KEY)
    • Same step ID (app-token)
  2. Security considerations

    • Action is pinned to commit hash (supply chain protection)
    • Fork PRs are excluded in ci.yml via github.event.pull_request.head.repo.full_name == github.repository
    • Tokens passed via env vars are automatically masked by GitHub Actions
    • Graceful fallback with if [ -n "$APP_TOKEN" ] check
  3. Implementation correctness

    • The git remote set-url is executed before the push in both workflows
    • Conditional logic properly gates token generation to when it's needed
    • Comments clearly explain the rationale
  4. No changeset needed — This is a CI/tooling-only change with no user-facing package modifications.


✅ APPROVE

Summary: Clean, well-documented CI fix that follows established patterns. The implementation correctly solves the problem of auto-commits not triggering downstream workflows, and the test plan in the PR description provides good verification steps.

Reviewers (3)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-devops 0 0 0 0 0 0 0
pr-review-standards 0 0 0 0 0 0 0
pr-review-appsec 0 0 0 0 0 0 0
Total 0 0 0 0 0 0 0

@github-actions github-actions bot deleted a comment from claude bot Mar 27, 2026
@amikofalvy amikofalvy added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit b204079 Mar 27, 2026
20 checks passed
@amikofalvy amikofalvy deleted the fix/bot-commits-trigger-ci branch March 27, 2026 19:33
amikofalvy added a commit that referenced this pull request Mar 30, 2026
The changesets/action pushes commits using the default GITHUB_TOKEN
credential, which GitHub ignores for triggering downstream workflows.
This left the Version Packages PR (#2881) stuck with required checks
(ci, Cypress E2E, Create Agents E2E) permanently waiting.

Configures the git remote URL with the inkeep-internal-ci App token
before changesets/action runs — same pattern applied to ci.yml and
auto-format.yml in #2871.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 30, 2026
The changesets/action pushes commits using the default GITHUB_TOKEN
credential, which GitHub ignores for triggering downstream workflows.
This left the Version Packages PR (#2881) stuck with required checks
(ci, Cypress E2E, Create Agents E2E) permanently waiting.

Configures the git remote URL with the inkeep-internal-ci App token
before changesets/action runs — same pattern applied to ci.yml and
auto-format.yml in #2871.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 30, 2026
* fix(ci): configure git remote with App token in release workflow

The changesets/action pushes commits using the default GITHUB_TOKEN
credential, which GitHub ignores for triggering downstream workflows.
This left the Version Packages PR (#2881) stuck with required checks
(ci, Cypress E2E, Create Agents E2E) permanently waiting.

Configures the git remote URL with the inkeep-internal-ci App token
before changesets/action runs — same pattern applied to ci.yml and
auto-format.yml in #2871.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* perf(ci): skip container init for changeset PRs by extracting check job

Service containers (Doltgres, Postgres) in cypress-e2e and
create-agents-e2e were initialized before the changeset check ran,
wasting ~30s of ubuntu-32gb runner time on every changeset PR.

Extracts the changeset check into a lightweight job on ubuntu-latest
that runs first. The heavy jobs now depend on it via `needs:` and
skip entirely (including container init) when it's a changeset PR.

Also removes all redundant step-level `if: changeset-check` guards
since the job-level `if` already gates everything.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(ci): extract changeset check into reusable composite action

The changeset detection logic (~60 lines of shell) was duplicated
across ci.yml and cypress.yml. Extracts it into a shared composite
action at .github/composite-actions/changeset-check/action.yml.

Both workflows now do a sparse checkout (just the composite action
directory) and delegate to the shared action, keeping the changeset
detection logic in one place.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tim-inkeep pushed a commit that referenced this pull request Mar 31, 2026
The changesets/action pushes commits using the default GITHUB_TOKEN
credential, which GitHub ignores for triggering downstream workflows.
This left the Version Packages PR (#2881) stuck with required checks
(ci, Cypress E2E, Create Agents E2E) permanently waiting.

Configures the git remote URL with the inkeep-internal-ci App token
before changesets/action runs — same pattern applied to ci.yml and
auto-format.yml in #2871.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tim-inkeep pushed a commit that referenced this pull request Mar 31, 2026
* fix(ci): configure git remote with App token in release workflow

The changesets/action pushes commits using the default GITHUB_TOKEN
credential, which GitHub ignores for triggering downstream workflows.
This left the Version Packages PR (#2881) stuck with required checks
(ci, Cypress E2E, Create Agents E2E) permanently waiting.

Configures the git remote URL with the inkeep-internal-ci App token
before changesets/action runs — same pattern applied to ci.yml and
auto-format.yml in #2871.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* perf(ci): skip container init for changeset PRs by extracting check job

Service containers (Doltgres, Postgres) in cypress-e2e and
create-agents-e2e were initialized before the changeset check ran,
wasting ~30s of ubuntu-32gb runner time on every changeset PR.

Extracts the changeset check into a lightweight job on ubuntu-latest
that runs first. The heavy jobs now depend on it via `needs:` and
skip entirely (including container init) when it's a changeset PR.

Also removes all redundant step-level `if: changeset-check` guards
since the job-level `if` already gates everything.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(ci): extract changeset check into reusable composite action

The changeset detection logic (~60 lines of shell) was duplicated
across ci.yml and cypress.yml. Extracts it into a shared composite
action at .github/composite-actions/changeset-check/action.yml.

Both workflows now do a sparse checkout (just the composite action
directory) and delegate to the shared action, keeping the changeset
detection logic in one place.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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