Skip to content

ci: tag an eligible release candidate from a workflow, with a key no agent holds #5208

Closed

Description

@yannickmonney

Why

An agent now releases the stable line from start to finish, as .github/RELEASING.md describes. This is Development's Lead on agents.tale.dev, and it covers the notes, the candidate's validation, the gate, the tag and the check afterwards. The tag is the one step it cannot take. The Release tags ruleset (refs/tags/v*, refs/tags/[0-9]*) lets only admins and maintainers create a release tag, and the agents' GitHub accounts have the write role.

They should not get that right. A token that can create a release tag can publish any commit it can push, without review or CI. So the tag should be pushed by a workflow on main that checks the candidate itself, using a key that no other workflow and no agent can use.

What to build

A workflow .github/workflows/release-tag.yml:

  • Trigger and inputs. It runs on repository_dispatch with types: [release-tag]. The client_payload carries candidate_sha (a full 40-character SHA) and version (vX.Y.Z). Pass both through env: and refuse anything that does not match the patterns release.yml's Prepare uses, before any other step.
  • Permissions. permissions: { contents: read, actions: read }.
  • Concurrency. A group of its own with cancel-in-progress: false.
  • One job, environment: release. That environment exists. Only main may deploy to it, and it holds the secret RELEASE_TAG_DEPLOY_KEY: the private half of the repository's write deploy key release-tag workflow. The Release tags ruleset lets that key create release tags; it is the ruleset's only deploy-key bypass. No other workflow may name the environment.

The job's steps:

  1. Check out the candidate with full history, the tags and persist-credentials: false. Refuse a candidate that is not on main: git merge-base --is-ancestor <sha> origin/main must succeed.
  2. Set up Bun as release.yml does, with the same pinned action and version.
  3. Run the gate from that checkout with GH_TOKEN: ${{ github.token }}: bun tools/cli/scripts/release-candidate-gate.ts --sha <sha> --version <version>. Any result but exit 0 (eligible) ends the run red, with the gate's report in the step summary.
  4. Push the tag over SSH with the deploy key: git push [email protected]:tale-project/tale.git <sha>:refs/tags/<version>.
    • Write the key to a file under $RUNNER_TEMP with mode 600, and remove it in an if: always() step.
    • Pin github.com's host keys from https://api.github.com/meta (ssh_keys), never from ssh-keyscan.
    • A deploy key's push starts release.yml, as a person's tag push does. A GITHUB_TOKEN push would start nothing.
  5. Write the tag, the commit and the gate's state to the step summary.

Docs

  • .github/RELEASING.md step 4: the tag comes from this workflow, requested with
    gh api repos/tale-project/tale/dispatches -f event_type=release-tag -f 'client_payload[candidate_sha]=<sha>' -f 'client_payload[version]=vX.Y.Z'.
    A person with the admin or maintain role can still push one by hand. Also describe how the environment, the deploy key and the ruleset bypass are set up.
  • .github/CI.md lists the workflow wherever it lists the others.

Done when

  • Tests in the repository's workflow tests (where the tests that read release.yml live) show:
    • the workflow refuses a malformed SHA or version, a commit not on main, and a gate state other than eligible, and pushes nothing in any of those cases;
    • no other workflow names environment: release;
    • nothing prints the key, and the key file is removed in an always() step.
  • The fast gate passes.

Line: stable. It is a ci change to how main is released.

Activity

  1. added
    priority: high
    improvement
    agent-ready
    on Oct 31, 2026
  2. added a commit that references this issue on Oct 31, 2026
    7496cc0
  3. added a commit that references this issue on Oct 31, 2026
    ac879dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyimprovementpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions