-
Notifications
You must be signed in to change notification settings - Fork 13
Allow manual image build #879
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 1 commit
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 | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,11 @@ on: | |||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||||||||||||
| - '*' | ||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||
| version: | ||||||||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||
| DOCKER_IMAGE_URL: ${{ vars.REPO_DOCKER_IMAGE_URL }} | ||||||||||||||||||||||||||||||||||||
|
|
@@ -22,7 +27,7 @@ jobs: | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Set Gateway Version | ||||||||||||||||||||||||||||||||||||
| id: set_version | ||||||||||||||||||||||||||||||||||||
| run: echo "GATEWAY_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo 'unknown')" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||
| run: echo "GATEWAY_VERSION=$(echo '${{ inputs.version }}' || git describe --tags --abbrev=0 2>/dev/null || echo 'unknown')" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||
|
Contributor
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. Broken fallback: echo always succeeds; tag builds will set an empty GATEWAY_VERSION.
Use an explicit emptiness check and prefer the event’s tag name when available: - run: echo "GATEWAY_VERSION=$(echo '${{ inputs.version }}' || git describe --tags --abbrev=0 2>/dev/null || echo 'unknown')" >> $GITHUB_OUTPUT
+ run: |
+ set -euo pipefail
+ ver="${{ inputs.version || '' }}"
+ # On tag pushes, GitHub exposes the tag as GITHUB_REF_NAME
+ if [ -z "$ver" ]; then
+ ver="${GITHUB_REF_NAME:-}"
+ fi
+ # Fallback to git describe if still empty (e.g., manual run without input)
+ if [ -z "$ver" ]; then
+ ver="$(git describe --tags --abbrev=0 2>/dev/null || true)"
+ fi
+ if [ -z "$ver" ]; then
+ echo "error: GATEWAY_VERSION could not be determined" >&2
+ exit 1
+ fi
+ echo "GATEWAY_VERSION=$ver" >> "$GITHUB_OUTPUT"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Collaborator
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. @turbolent Is the AI here right? Have you tried this workflow? Or it needs merge first?
Contributor
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.
Collaborator
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. Update: It seems the AI is right indeed. |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Google auth | ||||||||||||||||||||||||||||||||||||
| id: auth | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.