Only sign docker image on tags and main branch

This commit is contained in:
Quentin Gliech committed 2022-02-08 09:04:39 +01:00
1 parent cb24cd095b
commit 6bb7739401
1 file changed
+5 -1
+5 -1
View File
@@ -357,7 +357,11 @@ jobs:
base.cache-to=type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
- name: Sign the images with GitHub Actions provided token
if: github.event_name != 'pull_request'
# Only sign on tags and on commits on main branch
if: |
github.event_name != 'pull_request'
&& (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: cosign sign ${TAGS}
env:
TAGS: "${{ steps.meta.outputs.tags }} ${{ steps.meta-debug.outputs.tags }}"