Skip to content

Push the release tag with a deploy key - #45

Merged
Etelis merged 2 commits into
mainfrom
release-draft
Nov 20, 2026
Merged

Etelis merged 2 commits into
mainfrom
release-draft

Conversation

@almogtavor

@almogtavor almogtavor commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Problem

The release job failed for v1.2.1 with HTTP 422: Cannot create ref due to creations being restricted. The "Protect release tags" ruleset allows only bypass actors to create a v* tag, and the workflow token is not one of them, so gh release create could not create the tag.

Change

The workflow keeps creating the tag and the release by itself:

  • After the build and the distribution checks, the job pushes v<version> over SSH with the deploy key stored in the RELEASE_DEPLOY_KEY secret. "Deploy keys" is in the bypass list of the ruleset.
  • The job then runs gh release create --verify-tag with the workflow token, which attaches the wheel and the sdist to the existing tag.
  • The SSH connection checks github.com against its published Ed25519 host key, and the key file is removed right after the push.

Setup that already exists

  • Deploy key "release workflow" with write access on this repository.
  • Actions secret RELEASE_DEPLOY_KEY with the private half.
  • "Deploy keys" in the bypass list of the "Protect release tags" ruleset.

Checks

  • The workflow file parses, and the pinned host key matches https://api.github.com/meta.
  • I published v1.2.1 by hand, so merging this pull request starts a run that skips the build. The tag push runs for the first time with the next version.

@almogtavor
almogtavor requested a review from Etelis as a code owner November 20, 2026 18:25
The "Protect release tags" ruleset rejects a v* tag created by the workflow
token. The workflow now pushes the tag over SSH with the deploy key in the
RELEASE_DEPLOY_KEY secret, which is in the bypass list of the ruleset, and
then creates the release on that tag.
@almogtavor almogtavor changed the title Prepare a draft release instead of creating the protected tag Push the release tag with a deploy key Nov 20, 2026
@Etelis
Etelis merged commit 575d2f9 into main Nov 20, 2026
4 checks passed
@Etelis
Etelis deleted the release-draft branch November 20, 2026 18:43
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.

2 participants