@@ -107,7 +107,7 @@ jobs:
107
107
username : ${{ github.actor }}
108
108
password : ${{ github.token }}
109
109
registry : ${{ env.IMAGE_REGISTRY }}
110
- if : github.event_name == 'push' && startsWith( github.event. ref, 'refs/tags')
110
+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
111
111
112
112
- name : Publish
113
113
id : push
@@ -116,21 +116,21 @@ jobs:
116
116
image : ${{ steps.build_image.outputs.image }}
117
117
tags : ${{ steps.current-version.outputs.value }} ${{ steps.build_image.outputs.tags }}
118
118
registry : ${{ env.IMAGE_REGISTRY }}
119
- if : github.event_name == 'push' && startsWith( github.event. ref, 'refs/tags')
119
+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
120
120
121
121
- name : Generate attestation for images
122
122
uses : actions/attest-build-provenance@v2
123
123
with :
124
124
subject-name : ${{ env.IMAGE_REGISTRY }}/${{ steps.build_image.outputs.image }}
125
125
subject-digest : ${{ steps.push.outputs.digest }}
126
126
push-to-registry : true
127
- if : github.event_name == 'push' && startsWith( github.event. ref, 'refs/tags')
127
+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
128
128
129
- version-changed :
129
+ mark-previous-version :
130
130
needs : [build, meta]
131
131
runs-on : ubuntu-latest
132
132
133
- if : github.event_name == 'pull_request ' && needs.build.outputs.current-version != needs.meta.outputs.latest-version
133
+ if : github.event_name == 'push' && github.ref == 'refs/heads/main ' && needs.build.outputs.current-version != needs.meta.outputs.latest-version
134
134
135
135
permissions :
136
136
contents : write
@@ -139,13 +139,13 @@ jobs:
139
139
- name : Checkout current head
140
140
uses : actions/checkout@v4
141
141
with :
142
- ref : ${{ github.event.pull_request.base.ref }}
142
+ ref : ${{ github.event.before }}
143
143
144
144
- name : Mark the current head with the latest version before the update
145
145
run : git tag v${{ needs.build.outputs.current-version }} && git push origin v${{ needs.build.outputs.current-version }}
146
146
147
147
automerge :
148
- needs : [ build, version-changed]
148
+ needs : build
149
149
runs-on : ubuntu-latest
150
150
151
151
if : (!cancelled() && github.event_name == 'pull_request' && github.actor == 'dependabot[bot]')
0 commit comments