11name : Add Git Trailers to PR commits
22
33on :
4- pull_request_review :
5- types : [submitted]
6-
7- concurrency :
8- group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9- cancel-in-progress : true
4+ workflow_call :
5+ secrets :
6+ GIT_CLONE_PAT :
7+ required : false
8+ URUNC_BOT_PRIVATE_KEY :
9+ required : true
1010
1111permissions :
1212 contents : read
1313
1414jobs :
1515 git-trailers :
1616 name : Add Git Trailers
17- if : >-
18- github.event.pull_request.base.ref == 'main' &&
19- github.event.review.state == 'approved'
20- runs-on : ubuntu-22.04
17+ runs-on : ${{ matrix.runner }}
18+ strategy :
19+ matrix :
20+ include :
21+ - arch : amd64
22+ runner : ubuntu-22.04
23+ continue-on-error : true
2124 permissions :
2225 contents : write
26+ pull-requests : write
2327 steps :
2428 - name : Harden the runner (Audit all outbound calls)
2529 uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
@@ -36,23 +40,32 @@ jobs:
3640 fetch-depth : 0
3741 ref : ${{ github.event.pull_request.head.sha }}
3842
43+ - name : Append git trailers
44+ uses : nubificus/git-trailers@8e08c91bb4c1fd9cb1ccbd9cc8029c31acf8da66 # feat_use_rebase
45+ with :
46+ user_info : .github/contributors.yaml
47+
3948 - name : Generate urunc-bot token
4049 id : generate-token
4150 uses : actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
4251 with :
4352 app-id : ${{ vars.URUNC_BOT_APP_ID }}
4453 private-key : ${{ secrets.URUNC_BOT_PRIVATE_KEY }}
4554
55+ - name : Set up Git
56+ run : |
57+ git config --global user.name "urunc-bot[bot]"
58+ git config --global user.email "urunc-bot[bot]@users.noreply.github.com"
59+
4660 - name : Append git trailers
47- uses : nubificus/git-trailers@1d1595aacfd9239ae69d773cb895606daa17e538
61+ uses : nubificus/git-trailers@18fd322f3fbfd505b4de728974a4ac1f32f758a7 # feat_auto_merge
4862 with :
49- token : ${{ steps.generate-token.outputs.token }}
50- user-info : .github/contributors.yaml
63+ user_info : .github/contributors.yaml
5164
5265 - name : Merge PR
5366 env :
5467 GH_TOKEN : ${{ steps.generate-token.outputs.token }}
55- PR_URL : ${{ github.event.pull_request.html_url }}
5668 run : |
57- sleep 5 # Wait for github to get updated with the push. Otherwise merge will fail
69+ PR_URL=${{ github.event.pull_request.html_url }}
70+
5871 gh pr merge "$PR_URL" --rebase --admin
0 commit comments