From 1bce41278ce15e313f92286dc10179dda7e75da3 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:23:43 +0200 Subject: [PATCH] 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. --- .github/workflows/docker-manual.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-manual.yml b/.github/workflows/docker-manual.yml index 44e25534..59055838 100644 --- a/.github/workflows/docker-manual.yml +++ b/.github/workflows/docker-manual.yml @@ -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 \ No newline at end of file + sarif_file: trivy-results.sarif