Skip to content

Commit

Permalink
Update GitHub Actions workflow to set VERSION to 'master' when the gi…
Browse files Browse the repository at this point in the history
…thub.head_ref is 'master'.

This prevents attempting to extract a version from the branch name when on the master branch, ensuring the Docker image is tagged correctly.
  • Loading branch information
mjanez authored Sep 24, 2024
1 parent d8f5bbe commit 1bce412
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ jobs:

- name: Extract tag version from branch name
id: extract_tag_version
run: echo "VERSION=$(echo ${{ github.head_ref }} | sed 's/^ckan-//')" >> $GITHUB_ENV
run: |
if [ "${{ github.head_ref }}" = "master" ]; then
echo "VERSION=master" >> $GITHUB_ENV
else
echo "VERSION=$(echo ${{ github.head_ref }} | sed 's/^ckan-//')" >> $GITHUB_ENV
fi
- name: Extract Docker metadata
id: meta
Expand Down Expand Up @@ -76,4 +81,4 @@ jobs:
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: trivy-results.sarif
sarif_file: trivy-results.sarif

0 comments on commit 1bce412

Please sign in to comment.