@@ -15,20 +15,38 @@ jobs:
15
15
env :
16
16
HADRON_DISTRIBUTION : compass
17
17
steps :
18
- - uses : actions/checkout@v3
18
+ - name : Create Github App Token
19
+ uses : actions/create-github-app-token@v1
20
+ id : app-token
21
+ with :
22
+ app-id : ${{ vars.DEVTOOLS_BOT_APP_ID }}
23
+ private-key : ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
24
+
25
+ - name : Get GitHub App User ID
26
+ id : get-user-id
27
+ run : echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
28
+ env :
29
+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
30
+
31
+ - uses : actions/checkout@v4
19
32
with :
20
33
# don't checkout a detatched HEAD
21
34
ref : ${{ github.head_ref }}
22
35
23
36
# this is important so git log can pick up on
24
37
# the whole history to generate the list of AUTHORS
25
- fetch-depth : ' 0'
38
+ fetch-depth : " 0"
39
+ token : ${{ steps.app-token.outputs.token }}
26
40
41
+ - name : Set up Git
42
+ run : |
43
+ git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
44
+ git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
27
45
28
- - uses : actions/setup-node@v3
46
+ - uses : actions/setup-node@v4
29
47
with :
30
48
node-version : 20.16.0
31
- cache : ' npm'
49
+ cache : " npm"
32
50
33
51
34
52
run : |
@@ -40,38 +58,26 @@ jobs:
40
58
npm run bootstrap-ci
41
59
42
60
- name : Update AUTHORS
43
- run : npm run update-authors
61
+ run : |
62
+ npm run update-authors
63
+ git add AUTHORS \*/AUTHORS
44
64
45
65
- name : Update THIRD-PARTY-NOTICES.md
46
- run : npm run update-third-party-notices
66
+ run : |
67
+ npm run update-third-party-notices
68
+ git add THIRD-PARTY-NOTICES.md
47
69
48
70
- name : Update Security Test Summary
49
71
run : |
50
72
npm run update-security-test-summary
73
+ git add docs/security-test-summary.md
51
74
52
75
- name : Update tracking-plan.md
53
- run : npm run update-tracking-plan
54
-
55
- - name : Create Pull Request
56
- id : cpr
57
- uses : peter-evans/create-pull-request@v6
58
- with :
59
- commit-message : Update report
60
- branch : ci/update-3rd-party-notices-and-authors
61
- title : ' chore: update AUTHORS, THIRD-PARTY-NOTICES, Security Test Summary'
62
- add-paths : |
63
- THIRD-PARTY-NOTICES.md
64
- AUTHORS
65
- docs/security-test-summary.md
66
- docs/tracking-plan.md
67
- body : |
68
- - Update `AUTHORS`, `THIRD-PARTY-NOTICES`, docs/tracking-plan.md and `docs/security-test-summary.md`
76
+ run : |
77
+ npm run update-tracking-plan
78
+ git add docs/tracking-plan.md
69
79
70
- - name : Merge PR
71
- env :
72
- PULL_REQUEST_NUMBER : ${{steps.cpr.outputs.pull-request-number}}
73
- # NOTE: we don't use a PAT so to not trigger further automation
74
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
80
+ - name : Commit and push
75
81
run : |
76
- gh pr merge $PULL_REQUEST_NUMBER --squash --delete-branch
77
- gh workflow run codeql.yml -r main
82
+ git commit --no-allow-empty -m "chore: update AUTHORS, THIRD-PARTY-NOTICES, Security Test Summary [skip actions]" || true
83
+ git push
0 commit comments