@@ -221,7 +221,7 @@ jobs:
221
221
steps :
222
222
- uses : actions/checkout@v2
223
223
224
- - name : set the tag sdk/go/v*
224
+ - name : Set the tag to sdk/go/v*
225
225
shell : bash
226
226
run : echo "GO_SDK_TAG=sdk/go/${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
227
227
@@ -233,24 +233,18 @@ jobs:
233
233
git tag ${{ env.GO_SDK_TAG }}
234
234
git push origin ${{ env.GO_SDK_TAG }}
235
235
236
- commit-and- create-template-tag :
237
- name : Change sdk version in templates and create a new tag spin/templates/v*
236
+ create-template-sdk-update-pr :
237
+ name : Create PR with template SDK updates
238
238
runs-on : ubuntu-latest
239
239
needs : create-go-sdk-tag
240
240
if : startsWith(github.ref, 'refs/tags/v')
241
241
steps :
242
242
- uses : actions/checkout@v2
243
243
244
- - name : set the spin tag
244
+ - name : Set the spin tag
245
245
shell : bash
246
246
run : echo "SPIN_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
247
247
248
- - name : set the tag spin/templates/v*
249
- shell : bash
250
- run : |
251
- IFS=. read -r major minor patch <<< "${{ env.SPIN_TAG }}"
252
- echo "TEMPLATE_TAG=spin/templates/$major.$minor" >> $GITHUB_ENV
253
-
254
248
- name : Change sdk version
255
249
shell : bash
256
250
run : |
@@ -265,19 +259,33 @@ jobs:
265
259
git_user_signingkey : true
266
260
git_commit_gpgsign : true
267
261
268
- - name : Commit changes
269
- uses : stefanzweifel/git-auto-commit-action @v4
262
+ - name : Create Pull Request
263
+ uses : peter-evans/create-pull-request @v4
270
264
with :
271
- commit_message : " feat(templates): update sdk to ${{ env.SPIN_TAG }}"
272
- commit_options : ' -s -S'
273
- commit_user_name : fermybot
274
- commit_user_email : 103076628+fermybot@users.noreply.github.com
275
- commit_author : fermybot <103076628+fermybot@users.noreply.github.com>
276
- file_pattern : templates/*
277
- branch : main
278
- skip_dirty_check : true
279
- skip_fetch : true
280
- skip_checkout : true
265
+ commit-message : " feat(templates): update sdk to ${{ env.SPIN_TAG }}"
266
+ title : " feat(templates): update sdk to ${{ env.SPIN_TAG }}"
267
+ body : Update the SDK version used by the templates
268
+ branch : update-sdk-${{ env.SPIN_TAG }}
269
+ base : main
270
+ delete-branch : true
271
+ committer : fermybot <103076628+fermybot@users.noreply.github.com>
272
+ author : fermybot <103076628+fermybot@users.noreply.github.com>
273
+ signoff : true
274
+
275
+ # This will run when the PR above is approved and merged into main via a merge commit
276
+ push-templates-tag :
277
+ runs-on : ubuntu-latest
278
+ needs : build
279
+ if : github.event.commits[0].author.name == 'fermybot' && contains(github.event.commits[0].message, 'update sdk')
280
+ steps :
281
+ - uses : actions/checkout@v2
282
+
283
+ - name : Set the tag to spin/templates/v*
284
+ shell : bash
285
+ run : |
286
+ spin_tag=$(echo "${{ github.event.commits[0].message }}" | grep -Eo v[0-9.]+)
287
+ IFS=. read -r major minor patch <<< "${spin_tag}"
288
+ echo "TEMPLATE_TAG=spin/templates/$major.$minor" >> $GITHUB_ENV
281
289
282
290
- name : Tag spin/templates/v* and push it
283
291
shell : bash
0 commit comments