Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- main
- release/v*
paths:
- '.github/workflows/docker.yml'
- '**.go'
Expand All @@ -27,13 +28,22 @@ jobs:
with:
images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }}

- name: Compute release branch tag
id: reltag
if: startsWith(github.ref_name, 'release/v')
shell: bash
run: |
RAW="${GITHUB_REF_NAME}"
SANITIZED="${RAW//\//-}"
echo "full_tag=${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }}:branch-${SANITIZED}" >> "$GITHUB_OUTPUT"

- name: Build Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
build-args: |
IBC_GO_VERSION=main
IBC_GO_VERSION=${{ github.ref_name }}

- name: Test simd is runnable
run: |
Expand All @@ -50,6 +60,8 @@ jobs:
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.reltag.outputs.full_tag }}
Comment on lines +63 to +65
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty steps.reltag.outputs.full_tag value when not on a release branch could cause build errors. Consider using a conditional expression to safely handle this case:

tags: |
  ${{ steps.meta.outputs.tags }}
  ${{ steps.reltag.outputs.full_tag != '' && steps.reltag.outputs.full_tag || '' }}

This ensures the tag is only included when it's defined, preventing potential errors on non-release branches.

Suggested change
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.reltag.outputs.full_tag }}
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.reltag.outputs.full_tag != '' && steps.reltag.outputs.full_tag || '' }}

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

build-args: |
IBC_GO_VERSION=main
IBC_GO_VERSION=${{ github.ref_name }}
Loading