Repository navigation
fix(ci): read GITHUB_OUTPUT from the environment in tag_release - #63
Open
Roman-Cohere wants to merge 1 commit into
Open
Roman-Cohere wants to merge 1 commit into
Roman-Cohere wants to merge 1 commit into
Conversation
The version step's heredoc is quoted ('PY'), so the shell does not expand
$GITHUB_OUTPUT and Python wrote the version to a file literally named
"$GITHUB_OUTPUT". The step output stayed empty and the tag step failed
with "'' is not a valid tag name" on every release since #37.
Co-authored-by: North Code <noreply@cohere.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tag_releasehas failed on every push tomainsince #37 added it. The "Determine version" step runs Python from a quoted heredoc (<<'PY'), so the shell leaves$GITHUB_OUTPUTunexpanded, and Python appends the version to a file literally named$GITHUB_OUTPUTin the workspace. The step's output stays empty, and "Create tag if missing" fails with:That happened on the merges of 0.4.4, 0.4.5 and #62 (0.4.6); those tags were pushed by hand.
Change
The script reads the path from
os.environ["GITHUB_OUTPUT"].Testing
GITHUB_OUTPUTset: it writesversion=0.4.6to that file.actionlintpasses.version=0.4.6, find the existing0.4.6tag and skip; the next version bump will tag itself.Note
Low Risk
CI-only change to how the release tagging step writes step outputs; no application runtime behavior.
Overview
Fixes
tag_releasefailing on every push tomainsince the “Determine version” step was added with a quoted heredoc (<<'PY'), which prevented the shell from expanding$GITHUB_OUTPUT. Python was appending the version to a workspace file literally named$GITHUB_OUTPUT, sosteps.version.outputs.versionstayed empty and tagging failed with an invalid tag name.The script now uses
os.environ["GITHUB_OUTPUT"]so the version is written to GitHub Actions’ output file as intended.Reviewed by Cursor Bugbot for commit bea900e. Bugbot is set up for automated code reviews on this repo. Configure here.