Skip to content

Pinning and upgrades

Pin callers to a release tag's full commit SHA with a release comment. The hosted Worker refuses commits outside CODEHAWK_RELEASES, even if GitHub can resolve them in the fork network. A reusable workflow and the composite action it calls are different references: GitHub loads the workflow from the caller's pin, then loads the action from the pin inside that workflow.

  1. Make the product changes in packages/action/src/, packages/shared/src/ and actions/. Run bun run build to refresh the seven bundles in packages/action/dist/, then run bun run verify. The pin history checks may fail until step 2. Commit the code, action files and dist together, and obtain the full code SHA with git rev-parse HEAD.
  2. Update every internal uses: bts-io/codehawk/actions/...@<sha> reference in .github/workflows/*.yml to that code SHA. Run bun run verify again. The tests check that the internal pins agree and that the action code and dist match the referenced commit. Commit only the pin updates. A workflow cannot name the commit that contains its own pin.
  3. Publish both commits to the action source repository through the release process. The second commit is the reusable workflow release pin.

When moving to this release, add id-token: write to each reusable workflow calling job. A called job cannot raise its caller's permissions, so the run fails to start if the caller omits it.

Use the full release commit that contains the updated .github/workflows/ files for PR scan, PR review/reply, weekly review, and fix requests. Verified fixes and browser flows also call their released reusable workflows. Direct composite callers need their own App key. Confirm updated inputs and permissions and run a controlled PR or dry run before rolling the pin out further.

An inference migration must update the trusted inference document, named credential forwarding, and isolated execution inputs (test and application images) together with the pin. See Migrating an existing installation.

See the caller examples and development commands.

Code Hawk commits are made in UTC. Use TZ=UTC git commit for every commit and keep explicit author and committer dates in UTC. The pre-commit hook enforces UTC for the local timezone and explicit author and committer dates. The public guard rejects other commit and annotated tag offsets before mirroring.

Run bun packages/action/scripts/public-guard.ts before publishing. It checks tracked working tree files and reports the path, line number and reason without printing matched content. Pass BEFORE..AFTER as full commit SHAs to also check added lines in every commit in that range, including changes later removed. The exact marker definition lines and the reviewed allowlist are excluded. Binary files containing zero bytes are skipped. Tests reuse that list for fixtures.

A reviewed exception goes in .public-guard-allow as one JSON array per line, containing the repository path and the exact allowed line. Blank lines and comments starting with # are accepted. An exception applies only to that path and unchanged text. Review exceptions as public content because their text is committed too.

Forgejo CI runs tests and the tree guard for pushes and pull requests to develop and main. The mirror workflow checks the tree and pushed range before using CODEHAWK_MIRROR_DEPLOY_KEY to push the single updated main or v* tag ref to bts-io/codehawk. New refs check their full ancestry. Mirror runs share a concurrency group and use a pinned GitHub SSH host key. Pushes never force updates. Work branches stay on the source forge.

GitHub checks changes to main and release tags independently. A mirrored v* tag gets a build provenance attestation for each bundle after GitHub verifies that a fresh build matches the committed files.

Sign the release tag and verify its signature locally with git verify-tag <tag> before mirroring. When publishing the release, copy the SHA-256 block from its GitHub Actions summary into the release notes. To check the digests yourself, run LC_ALL=C sha256sum packages/action/dist/*.mjs from a clean checkout of that tag.

Download a bundle from the release commit and verify its provenance with gh attestation verify <bundle> --repo bts-io/codehawk. Compare its SHA-256 checksum with the value in the release notes. GitHub artifact attestation documentation