ci: fix image tag to use version input when triggered via workflow_di…#108
Merged
Conversation
…spatch When triggered by workflow_dispatch, GITHUB_REF_NAME is the branch name (main), not the tag — causing docker/metadata-action to produce 'latest' instead of the release version. Now prefers inputs.new_operator_version when set, falling back to GITHUB_REF_NAME for tag-triggered runs. Also passes the resolved version explicitly to metadata-action semver tags so they work for both trigger types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vavarshn
approved these changes
Jun 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the release workflow’s version resolution so Docker image semver tags are generated correctly when the workflow is triggered via workflow_dispatch/workflow_call (where GITHUB_REF_NAME is a branch name, not a tag).
Changes:
- Resolve the release version by preferring
inputs.new_operator_versionwhen provided, otherwise falling back toGITHUB_REF_NAME. - Pass the resolved version explicitly into
docker/metadata-actionsemver tagging rules so semver tags work across trigger types.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
build-and-push-images stripped the leading 'v' but the package job used inputs.new_operator_version verbatim, so a v-prefixed input would produce divergent versions between image tags and Helm chart versions, potentially failing SemVer validation. Apply the same #v strip in the package job. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ed v prefix
Hardcoding v in value=v\${{...}} risked producing vv1.2.3 if the version step
ever changed. docker/metadata-action handles leading-v normalization itself,
so pass the bare version output directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vavarshn
approved these changes
Jun 15, 2026
Comment on lines
+83
to
90
| # Prefer explicit input (workflow_dispatch / workflow_call), fall back to tag ref | ||
| INPUT_VERSION="${{ inputs.new_operator_version }}" | ||
| if [[ -n "${INPUT_VERSION}" ]]; then | ||
| VERSION="${INPUT_VERSION#v}" | ||
| else | ||
| VERSION="${GITHUB_REF_NAME#v}" | ||
| fi | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT |
Comment on lines
168
to
+171
| elif [ -n "${{ inputs.new_operator_version }}" ]; then | ||
| # Use input version (for workflow_call) | ||
| # Use input version (for workflow_call / workflow_dispatch), strip leading v | ||
| VERSION="${{ inputs.new_operator_version }}" | ||
| VERSION="${VERSION#v}" |
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.
…spatch
When triggered by workflow_dispatch, GITHUB_REF_NAME is the branch name (main), not the tag — causing docker/metadata-action to produce 'latest' instead of the release version. Now prefers inputs.new_operator_version when set, falling back to GITHUB_REF_NAME for tag-triggered runs. Also passes the resolved version explicitly to metadata-action semver tags so they work for both trigger types.
Description
Related Issues
Type of Change
Changes Made
Testing Performed
make test)make lint)Test Environment
Test Steps
Documentation
Checklist
Breaking Changes
Impact:
Migration Path:
Screenshots/Recordings
Additional Notes
Reviewer Notes
Please pay special attention to:
Commit Message Convention: This PR follows Conventional Commits