Update GitHub Actions workflow to set VERSION to 'master' when the github.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.
This commit is contained in:
mjanez 2024-09-24 09:23:43 +02:00 committed by GitHub
parent d8f5bbe39f
commit 1bce41278c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -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
@ -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