Skip to content

ci(release): open the Homebrew formula PR with a GitHub App token - #813

Merged
hakula139 merged 2 commits into
mainfrom
ci/homebrew-app-token
Nov 2, 2026
Merged

hakula139 merged 2 commits into
mainfrom
ci/homebrew-app-token

Conversation

@hakula139

@hakula139 hakula139 commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

GitHub holds the pull_request runs of a PR opened with GITHUB_TOKEN until someone with write access approves them, and the dispatched ci.yml run does not report the PR's required checks. This opens the Homebrew formula PR with a GitHub App token instead.

  • Prerequisite: hakula-release-bot is installed on this repository with Contents and Pull requests write, and RELEASE_APP_ID and RELEASE_APP_PRIVATE_KEY are repository secrets.
  • App token: The Homebrew job mints a token with actions/create-github-app-token@v3 and uses it for the checkout and gh pr create, so its push starts the CI and Homebrew Formula workflows and the PR belongs to the App.
  • Workflow permissions: The job drops contents, issues, and pull-requests write because the App performs every write, and inherits the workflow-level contents: read.
  • Dispatch: The job no longer dispatches ci.yml or needs actions: write.
  • Docs: RELEASING.md now merges the formula PR like any other PR.

Closes #364

Test plan

  • nix develop .#lint -c pnpm format: pass
  • nix develop .#lint -c pnpm lint: pass
  • nix develop .#lint -c pnpm spellcheck: pass
  • nix shell nixpkgs#actionlint nixpkgs#shellcheck -c actionlint: pass, except for two false positives from actionlint 1.7.12's embedded metadata for create-github-app-token@v3, which predates the client-id rename. A scratch workflow pinned to v3.3.0 passes, and so does this workflow with those two errors ignored.
  • Pre-commit hooks on commit and push: pass
  • The Homebrew job runs only on a release tag, so the App token path stays untested until the next release. The Homebrew Formula check runs on this PR because it changes release.yml.

GitHub holds the pull_request runs of a PR opened with GITHUB_TOKEN until
someone with write access approves them, and the dispatched ci.yml run does
not report the PR's required checks. Pushing the branch and opening the PR
with a GitHub App installation token makes the pull_request workflow run
normally, so the job no longer dispatches ci.yml or needs actions: write.
@hakula139 hakula139 added this to the v0.1.0 milestone Nov 2, 2026
@hakula139 hakula139 added the ci Changes to CI, release, or build workflows (ci) label Nov 2, 2026
@hakula139 hakula139 self-assigned this Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Use client-id, which accepts the App ID and is not deprecated. The action
already scopes the token to the current repository, so the owner and
repositories inputs and the job-level permissions are redundant. Author
the formula commit as the App so the commit and PR share its identity.
@hakula139 hakula139 changed the title ci(release): open the Homebrew formula PR with an app token ci(release): open the Homebrew formula PR with a GitHub App token Nov 2, 2026
@hakula139
hakula139 merged commit a1abe8c into main Nov 2, 2026
21 checks passed
@hakula139
hakula139 deleted the ci/homebrew-app-token branch November 2, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Changes to CI, release, or build workflows (ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open the Homebrew formula PR with a GitHub App token so its CI runs without a dispatch

1 participant