@@ -271,9 +271,26 @@ jobs:
271
271
- merge-suc
272
272
permissions :
273
273
contents : write # needed for creating the GH release
274
+ id-token : write
274
275
steps :
276
+ - name : Read App Secrets
277
+ uses : rancher-eio/read-vault-secrets@main
278
+ with :
279
+ secrets : |
280
+ secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APP_ID ;
281
+ secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | PRIVATE_KEY
282
+
283
+ - name : Create App Token
284
+ uses : actions/create-github-app-token@v1
285
+ id : app-token
286
+ with :
287
+ app-id : ${{ env.APP_ID }}
288
+ private-key : ${{ env.PRIVATE_KEY }}
289
+
275
290
- name : Checkout code
276
291
uses : actions/checkout@v4
292
+ with :
293
+ token : ${{ steps.app-token.outputs.token }}
277
294
278
295
- name : Download binary
279
296
uses : actions/download-artifact@v4
@@ -299,6 +316,45 @@ jobs:
299
316
300
317
- name : Create release
301
318
env :
302
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
319
+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
303
320
run :
304
321
gh release create ${{ github.ref_name }} --verify-tag --generate-notes dist/*
322
+
323
+ dispatch :
324
+ permissions :
325
+ contents : read
326
+ id-token : write
327
+ runs-on : ubuntu-latest
328
+ timeout-minutes : 10
329
+ needs : github_release
330
+ strategy :
331
+ fail-fast : false
332
+ matrix :
333
+ target-branch : [release/v2.9, release/v2.10, main]
334
+ steps :
335
+ - name : Read App Secrets
336
+ uses : rancher-eio/read-vault-secrets@main
337
+ with :
338
+ secrets : |
339
+ secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APP_ID ;
340
+ secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | PRIVATE_KEY
341
+
342
+ - name : Create App Token
343
+ uses : actions/create-github-app-token@v1
344
+ id : app-token
345
+ with :
346
+ app-id : ${{ env.APP_ID }}
347
+ private-key : ${{ env.PRIVATE_KEY }}
348
+
349
+ - name : Checkout code
350
+ uses : actions/checkout@v4
351
+ with :
352
+ token : ${{ steps.app-token.outputs.token }}
353
+
354
+ - name : Run dispatch
355
+ run : |
356
+ ACTION_TARGET_BRANCH=${{ matrix.target-branch }}
357
+ echo "Dispatching to $ACTION_TARGET_BRANCH branch of rancher/rancher"
358
+ gh workflow run "System Agent Upgrade" --repo rancher/rancher --ref $ACTION_TARGET_BRANCH -F system_agent_version=${{ github.ref_name }} -F source_author=${{ github.actor }}
359
+ env :
360
+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
0 commit comments