feat: Added action for bumping release version - #116
Conversation
| [[tool.bumpversion.files]] | ||
| glob = "documentation/**/*.md" | ||
|
|
There was a problem hiding this comment.
Fixed an issue where bump-my-version would throw an error since some documentation markdown files do not have version numbers present
There was a problem hiding this comment.
🟡 Changes recommended
The workflow has validation, authentication, shell syntax, output propagation, and tag handling defects that prevent successful releases.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds release automation for version bumping, tagging, and draft release creation.
Changes:
- Adds a manually dispatched release workflow.
- Narrows documentation version updates to
DATA_FORMAT.md.
File summaries
| File | Description |
|---|---|
.github/workflows/release-new-version.yml |
Automates version bumps and draft releases. |
.bumpversion.toml |
Refines version-managed documentation files. |
Review details
Suppressed comments (5)
.github/workflows/release-new-version.yml:38
- This disables the only credentials available to the later
git push. Although the job grantscontents: write, no token is supplied to Git separately, so pushing to the HTTPS origin will fail authentication. Keep checkout credentials for the push (or explicitly authenticate the push).
persist-credentials: false
.github/workflows/release-new-version.yml:51
- This step fails before producing a tag:
${ BUMP_TYPE }is invalid shell substitution, and.bumpversion.tomlenables commits while Git identity is only configured in the following step. Configure the identity before running the bump and use valid variable expansion.
- name: Bump version
run: bump-my-version bump -v ${ BUMP_TYPE }
env:
BUMP_TYPE: ${{ inputs.increment }}
.github/workflows/release-new-version.yml:57
- Only pushing tags leaves the default branch at the old version even though
bump-my-versioncreates a version commit. A subsequent run will read the samecurrent_versionand attempt to recreate the existing tag, so push the generated commit together with its tags.
git push origin --tags
.github/workflows/release-new-version.yml:63
- Writing to
GITHUB_ENVcreates an environment variable for later steps; it does not createsteps.get-tag.outputs.VERSION_TAG, andoutputsis not a supported key on arunstep. Write directly toGITHUB_OUTPUTso the job output is populated.
run: echo "VERSION_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
outputs:
VERSION_TAG: ${{ env.VERSION_TAG }}
.github/workflows/release-new-version.yml:75
git describereturns the configured tag including itsvprefix (tag_name = "v{new_version}"), so prepending anothervasksghto create a differentvv…tag/release. Pass the emitted tag unchanged.
run: gh release create v${VERSION_TAG} --draft
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Authentication, shell syntax, branch pushing, output propagation, and release-tag handling currently prevent successful releases.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (4)
.github/workflows/release-new-version.yml:48
- This bump cannot complete on a fresh runner:
${ BUMP_TYPE }is invalid shell expansion, and.bumpversion.tomlhascommit = true, so Git needs the user identity before this command runs rather than in the following step. Configure Git first and use a valid quoted expansion.
- name: Bump version
run: bump-my-version bump -v ${ BUMP_TYPE }
.github/workflows/release-new-version.yml:56
- This pushes only the generated tag, leaving bump-my-version's version commit off the default branch. A subsequent run will check out the old version and attempt to recreate the same tag; push
HEADback to the selected default branch together with the tags.
git push origin --tags
.github/workflows/release-new-version.yml:74
git describealready returns the configuredv-prefixed tag, so prepending anothervtargetsvvX.Y.Z. Also,gh release createprompts for title/notes by default and cannot do so in this non-interactive job; pass the tag unchanged and select an automated notes mode.
run: gh release create v${VERSION_TAG} --draft
.github/workflows/release-new-version.yml:62
- A
runstep cannot declare anoutputsmapping, and writing to$GITHUB_ENVdoes not createsteps.get-tag.outputs.VERSION_TAG. This leaves the job output unavailable (or makes the workflow invalid); write the value directly to$GITHUB_OUTPUT.
run: echo "VERSION_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
outputs:
VERSION_TAG: ${{ env.VERSION_TAG }}
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| with: | ||
| client-id: ${{ vars.APP_CLIENT_ID }} | ||
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
| permission-contents: write |
There was a problem hiding this comment.
This happened because I was trying to follow zizmor guidance on avoiding persist-credentials: true in actions/checkout. I create a GitHub token and then pass it into the specific steps that I want to have access to it.
| @@ -0,0 +1,99 @@ | |||
| name: Release new version | |||
There was a problem hiding this comment.
Adapted with lots of modifications from https://github.com/AllenCell/github-restructure/blob/workflow-templates/.github/workflows/release-new-version-tag-only.yml
toloudis
left a comment
There was a problem hiding this comment.
seems like a lot of code to do this, but it all makes sense to me
Problem
Realized that I needed to set up version bumping for tfe-data! I referenced the existing action we have here (https://github.com/AllenCell/github-restructure/blob/workflow-templates/.github/workflows/release-new-version-tag-only.yml) but also reworked it to use the built-in tooling (
bump-my-version) installed in this repo.Estimated review size: small, 5 minutes
Solution
Type of change