Skip to content

Commit

Permalink
Replacing ref_name with ref, adding curlies for good measure
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Podivin <[email protected]>
  • Loading branch information
jpodivin committed Jan 18, 2024
1 parent 106ab3a commit 74e5f83
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request' && contains(github.ref_name, 'tag')
if: ${{ github.event_name != 'pull_request' && contains(github.ref, 'refs/tags/') }}
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
with:
cosign-release: 'v2.1.1'
Expand All @@ -50,7 +50,7 @@ jobs:
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request' && contains(github.ref_name, 'tag')
if: ${{ github.event_name != 'pull_request' && contains(github.ref, 'refs/tags/') }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -67,7 +67,7 @@ jobs:
tags: |
type=semver,pattern={{version}}
type=sha
type=semver,pattern={{version}},value=latest
type=raw,value=latest
# Build Docker image with Buildx (don't push)
# https://github.com/docker/build-push-action
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: docker/production
push: ${{ github.event_name != 'pull_request' && contains(github.ref_name, 'tag') }}
push: ${{ github.event_name != 'pull_request' && contains(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand All @@ -116,7 +116,7 @@ jobs:
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' && contains(github.ref_name, 'tag') }}
if: ${{ github.event_name != 'pull_request' && contains(github.ref, 'refs/tags/') }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
Expand Down

0 comments on commit 74e5f83

Please sign in to comment.