From 38b7bb621524b8e3eab8febcd70beec813acdb75 Mon Sep 17 00:00:00 2001 From: George Taylor Date: Tue, 12 Nov 2024 11:30:50 +0000 Subject: [PATCH] Update image-build.yml (#89) --- .github/workflows/image-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index cd699de..df2138f 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -36,7 +36,7 @@ jobs: - name: Create safe tag for image id: safe_tag run: | - if [ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.ref }}" != "main" ]; then + if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.head.ref }}" != "main" ]; then echo "SAFE_TAG=$(echo ${{ github.event.pull_request.head.ref }} | sed 's/[^a-zA-Z0-9.]/-/g')-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_OUTPUT else echo "SAFE_TAG=$(echo ${{ inputs.tag }} | sed 's/[^a-zA-Z0-9.]/-/g')" >> $GITHUB_OUTPUT @@ -45,7 +45,7 @@ jobs: - name: Output VERSION_REF id: output_version_ref run: | - if [ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.ref }}" != "main" ]; then + if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.head.ref }}" != "main" ]; then # if on a PR we need to get the current branch name echo "VERSION_REF=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT else