fix(ci): read release tag from event payload#1047
Open
stablegenius49 wants to merge 1 commit intoItzCrazyKns:masterfrom
Open
fix(ci): read release tag from event payload#1047stablegenius49 wants to merge 1 commit intoItzCrazyKns:masterfrom
stablegenius49 wants to merge 1 commit intoItzCrazyKns:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/docker-build.yaml">
<violation number="1" location=".github/workflows/docker-build.yaml:39">
P2: Directly embedding `github.event.release.tag_name` in an inline shell command allows shell-syntax injection during workflow execution.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| if: github.event_name == 'release' | ||
| id: version | ||
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
| run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV |
Contributor
There was a problem hiding this comment.
P2: Directly embedding github.event.release.tag_name in an inline shell command allows shell-syntax injection during workflow execution.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/docker-build.yaml, line 39:
<comment>Directly embedding `github.event.release.tag_name` in an inline shell command allows shell-syntax injection during workflow execution.</comment>
<file context>
@@ -36,7 +36,7 @@ jobs:
if: github.event_name == 'release'
id: version
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
+ run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Build and push AMD64 Docker image (master)
</file context>
Suggested change
| run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
| env: | |
| RELEASE_TAG: ${{ github.event.release.tag_name }} | |
| run: printf 'RELEASE_VERSION=%s\n' "$RELEASE_TAG" >> "$GITHUB_ENV" |
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.
What
github.event.release.tag_nameinstead of shell-expandingGITHUB_REFWhy
The
v1.12.1release Docker workflow failed with an emptyRELEASE_VERSION, which produced invalid manifest/image tags and left the versioned Docker image unpublished. The failed run wasdocker-build.yamlrun20614523992.Testing
v1.12.1release logs (gh run view 20614523992 --log-failed) to confirmRELEASE_VERSIONwas empty on the release pathgit diff --checkgithub.event.release.tag_namein all three release extraction steps and no longer references${GITHUB_REF#refs/tags/}Closes #1007
Summary by cubic
Fix Docker release workflow to read the tag from
github.event.release.tag_name, soRELEASE_VERSIONis set and images publish correctly. Addresses Linear #1007 wherev1.12.1produced empty tags.${GITHUB_REF#refs/tags/}withgithub.event.release.tag_namein all three release-only extraction steps to keep image tags consistent.Written for commit 8b79806. Summary will update on new commits.