Skip to content

Commit cd2162d

Browse files
sxdNiccoloFei
authored andcommitted
add condition, push only from main
Signed-off-by: Jonathan Gonzalez V <[email protected]>
1 parent e446018 commit cd2162d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/bake.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,13 @@ jobs:
122122
sarif_file: snyk.sarif
123123

124124
# Use the metadata generated in the `testbuild` step to find all the images
125-
# that have been built. We copy them one by one to the procuction registry
125+
# that have been built. We copy them one by one to the production registry
126126
# using skopeo. Then we sign the production images too.
127127
copytoproduction:
128128
name: Copy images to production
129-
if: github.event.inputs.environment == 'production' || github.event_name == 'schedule'
129+
if: |
130+
github.ref == 'refs/heads/main' &&
131+
( github.event.inputs.environment == 'production' || github.event_name == 'schedule' )
130132
runs-on: ubuntu-latest
131133
needs:
132134
- testbuild
@@ -182,4 +184,4 @@ jobs:
182184
'
183185
)
184186
echo "Signing ${images}"
185-
cosign sign --yes ${images}
187+
cosign sign --yes ${images}

0 commit comments

Comments
 (0)