|
14 | 14 | # Assign commit authorship to official Github Actions bot: |
15 | 15 | GIT_USER: github-actions[bot] |
16 | 16 | GIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com |
| 17 | + BRANCH_NAME: contributors-update |
17 | 18 |
|
18 | 19 | jobs: |
19 | 20 | add-contributors: |
|
23 | 24 | - name: 'Checkout' |
24 | 25 | uses: actions/checkout@v3 |
25 | 26 |
|
| 27 | + - name: 'Checkout New Branch and Push It' |
| 28 | + run: | |
| 29 | + git checkout -b ${{ env.BRANCH_NAME }} |
| 30 | + git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:${{ env.BRANCH_NAME }} |
| 31 | + git checkout master |
| 32 | +
|
26 | 33 | # See https://github.com/marketplace/actions/auto-add-contributors for reference of the action. |
27 | 34 | # |
28 | 35 | # This action is not well documented, but it does the job for now. We pin the version in order |
|
31 | 38 | uses: BobAnkh/add-contributors@v0.2.2 |
32 | 39 | with: |
33 | 40 | ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 41 | + BRANCH: ${{ env.BRANCH_NAME }} |
34 | 42 | COMMIT_MESSAGE: 'docs: update `CONTRIBUTORS.md`' |
35 | 43 | PATH: /CONTRIBUTORS.md |
36 | 44 | CONTRIBUTOR: '## Contributors' |
|
45 | 53 | id: create-pr |
46 | 54 | with: |
47 | 55 | token: ${{ secrets.GITHUB_TOKEN }} |
48 | | - branch: contributors-update |
| 56 | + base: master |
| 57 | + branch: ${{ env.BRANCH_NAME }} |
49 | 58 | title: 'docs: update `CONTRIBUTORS.md`' |
50 | 59 | commit-message: 'docs: update `CONTRIBUTORS.md`' |
51 | 60 | delete-branch: true |
|
70 | 79 | token: ${{ secrets.GITHUB_TOKEN }} |
71 | 80 | # Skipped workflows are still assigned a "success" status: |
72 | 81 | status: success |
73 | | - # This should be the correct commit SHA on the contributors-update branch: |
| 82 | + # This should be the correct commit SHA on ${{ env.BRANCH_NAME }}: |
74 | 83 | sha: ${{ steps.create-pr.outputs.pull-request-head-sha }} |
75 | 84 | # Name of status check to add/update: |
76 | 85 | context: lint |
|
0 commit comments