-
Notifications
You must be signed in to change notification settings - Fork 0
ci: trim whitespace from tag input in release workflows #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,8 +34,10 @@ jobs: | |||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - name: Resolve tag | ||||||||||||||||||||||||||||||||
| id: resolve | ||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||
| RAW_TAG: ${{ inputs.tag || github.ref_name }} | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| TAG="${{ inputs.tag || github.ref_name }}" | ||||||||||||||||||||||||||||||||
| TAG=$(echo "$RAW_TAG" | xargs) | ||||||||||||||||||||||||||||||||
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||
|
Comment on lines
+37
to
41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an empty-tag guard after trimming. After Line [40], validate Suggested patch run: |
TAG=$(echo "$RAW_TAG" | xargs)
+ if [[ -z "$TAG" ]]; then
+ echo "::error::Tag is empty after trimming whitespace"
+ exit 1
+ fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Extract metadata from tag | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against whitespace-only dispatch input.
Line [40] can produce an empty
TAG; add an explicit check to fail with a clear error before metadata/release jobs run.Suggested patch
run: | TAG=$(echo "$RAW_TAG" | xargs) + if [[ -z "$TAG" ]]; then + echo "::error::Tag is empty after trimming whitespace" + exit 1 + fi echo "tag=$TAG" >> "$GITHUB_OUTPUT"🤖 Prompt for AI Agents