Skip to content

feat: add automatic major version tag update to release workflow#120

Merged
zkoppert merged 5 commits intomainfrom
jm_major_version_updater
Mar 20, 2026
Merged

feat: add automatic major version tag update to release workflow#120
zkoppert merged 5 commits intomainfrom
jm_major_version_updater

Conversation

@jmeridth
Copy link
Copy Markdown
Collaborator

@jmeridth jmeridth commented Mar 20, 2026

What

Added an update_major_tag job to the reusable release workflow that force-updates the major version tag (e.g., v1) to point at the latest full semver tag (e.g., v1.2.3) after each release. Controlled by a new update-major-tag boolean input that defaults to true.

Why

Consumers of this reusable workflow previously had to implement major version tag updates themselves in their own release workflows. Embedding this directly means all consuming repos get this behavior automatically without duplicating workflow code.

Notes

  • Defaults to true, so all existing consumers will start getting major tag updates on their next release — worth communicating this in release notes
  • Consumers can opt out by passing update-major-tag: false
  • Uses persist-credentials: true to ensure the username and credentials are available to the git push of the new tag
  • Reviewers should verify that the GITHUB_TOKEN env var approach works with persist-credentials: false for force-pushing tags — the existing major-version-updater.yaml uses this same pattern but may not have been exercised recently

## What

Added an `update_major_tag` job to the reusable release workflow that
force-updates the major version tag (e.g., `v1`) to point at the latest
full semver tag (e.g., `v1.2.3`) after each release. This is controlled
by a new `update-major-tag` boolean input that defaults to `true`.

## Why

Consumers of this reusable workflow previously had to implement major
version tag updates themselves in their own release workflows. By
embedding this directly in the reusable workflow, all consuming repos
get this behavior automatically without duplicating workflow code.

## Notes

- Defaults to `true`, so all existing consumers will start getting major tag updates on their next release — this is intentional but worth communicating
- Consumers can opt out by passing `update-major-tag: false`
- Uses `persist-credentials: false` with explicit `GITHUB_TOKEN` env var for git push auth, matching the pattern used in the existing `major-version-updater.yaml` workflow
- The calling workflow must have `contents: write` permission for the force-push to succeed (already required by the `create_release` job)

Signed-off-by: jmeridth <jmeridth@gmail.com>
@jmeridth jmeridth requested a review from zkoppert as a code owner March 20, 2026 02:29
@jmeridth jmeridth self-assigned this Mar 20, 2026
Signed-off-by: jmeridth <jmeridth@gmail.com>
@jmeridth
Copy link
Copy Markdown
Collaborator Author

Testing this on another repo. Got an error. Please do not merge.

Signed-off-by: jmeridth <jmeridth@gmail.com>
@jmeridth
Copy link
Copy Markdown
Collaborator Author

@zkoppert

Successful test. This is ready to review, merge, and release. I'll update all repos that use this and remove manual major-version-updater job from stale-repos.

Signed-off-by: jmeridth <jmeridth@gmail.com>
Signed-off-by: jmeridth <jmeridth@gmail.com>
Copy link
Copy Markdown
Contributor

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Should we add a breaking or major label on it?

@jmeridth
Copy link
Copy Markdown
Collaborator Author

Looks good! Should we add a breaking or major label on it?

Great question. As this is something that doesn't break anything for the user and just adds a tag, I'm good with a minor update (so feature + release labels). I've given them a way to turn it off if they want with turn the new update-major-tag to false. What do you think?

@zkoppert zkoppert merged commit a0cf79b into main Mar 20, 2026
9 checks passed
@zkoppert zkoppert deleted the jm_major_version_updater branch March 20, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants