Skip to content

Validate the release tag before publishing the gem - #110

Merged
paracycle merged 1 commit into
mainfrom
ufuk/validate-release-tag
Oct 27, 2026
Merged

paracycle merged 1 commit into
mainfrom
ufuk/validate-release-tag

Conversation

@paracycle

Copy link
Copy Markdown
Member

Motivation

The release workflow from #108 publishes the gem for every vX.Y.Z tag push. It does not check the tag first. These problems can occur:

  • A tag that does not match Oktakit::VERSION publishes the version in Oktakit::VERSION. For example, a v1.1.1 tag on a commit with version 1.1.0 publishes 1.1.0.
  • A tag on a commit that is not on main also publishes a gem.

Changes

  • Add a Validate release tag step to the release_gem job, before the step that publishes the gem. The step fails the job in these cases:
    • The tagged commit is not an ancestor of origin/main.
    • The tag is not v followed by Oktakit::VERSION.
  • Check out the full history (fetch-depth: 0), so that the step can compare the commit with origin/main.

The checks are the same as the checks in #106.

The release workflow now fails before it publishes the gem in these cases:

- The tagged commit is not on main.
- The tag is not v followed by Oktakit::VERSION.

Without this check, a wrong tag published the gem at the version in Oktakit::VERSION.
@paracycle
paracycle merged commit 8db5504 into main Oct 27, 2026
4 checks passed
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