Skip to content

Commit

Permalink
Update workflow artifact download when tag is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jan 3, 2025
1 parent c46704a commit a61d297
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ jobs:
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern=v{{version}}
- name: Tag build artifacts
id: tag
shell: bash
run: |
if [ "${GITHUB_REF/refs\/tags\//}" == "refs/heads/master" ]; then
echo "value=$GIT_SHA" >> $GITHUB_OUTPUT
else
echo "value=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
fi
env:
GIT_SHA: ${{ github.sha }}

- name: hadolint
uses: hadolint/hadolint-action@v3.0.0
with:
Expand All @@ -128,7 +140,7 @@ jobs:
- name: Download
uses: actions/download-artifact@v3
with:
name: kupo-${{ github.sha }}-${{ matrix.arch }}-${{ matrix.os }}
name: kupo-${{ steps.tag.outputs.value }}-${{ matrix.arch }}-${{ matrix.os }}

- name: Build and push (latest)
if: ${{ github.event_name == 'push' }}
Expand Down

0 comments on commit a61d297

Please sign in to comment.