diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index 1c4f066..9e1a92b 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -29,8 +29,8 @@ jobs: - name: Create safe tag for image id: safe_tag run: | - if ${{ github.event_name }} == 'pull_request'; then - echo "SAFE_TAG=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9.]/-/g')-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_OUTPUT + if "${{ github.event_name }}" == "pull_request"; 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 ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9.]/-/g')" >> $GITHUB_OUTPUT fis