Skip to content

Commit a40f753

Browse files
ci: fix contributors workflow (again) (docker-mailserver#3304)
1 parent 2bdbe5d commit a40f753

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/contributors.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
# Assign commit authorship to official Github Actions bot:
1515
GIT_USER: github-actions[bot]
1616
GIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
17+
BRANCH_NAME: contributors-update
1718

1819
jobs:
1920
add-contributors:
@@ -23,6 +24,11 @@ jobs:
2324
- name: 'Checkout'
2425
uses: actions/checkout@v3
2526

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+
2632
# See https://github.com/marketplace/actions/auto-add-contributors for reference of the action.
2733
#
2834
# This action is not well documented, but it does the job for now. We pin the version in order
@@ -31,6 +37,7 @@ jobs:
3137
uses: BobAnkh/add-contributors@v0.2.2
3238
with:
3339
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
40+
BRANCH: ${{ env.BRANCH_NAME }}
3441
COMMIT_MESSAGE: 'docs: update `CONTRIBUTORS.md`'
3542
PATH: /CONTRIBUTORS.md
3643
CONTRIBUTOR: '## Contributors'
@@ -45,7 +52,8 @@ jobs:
4552
id: create-pr
4653
with:
4754
token: ${{ secrets.GITHUB_TOKEN }}
48-
branch: contributors-update
55+
base: master
56+
branch: ${{ env.BRANCH_NAME }}
4957
title: 'docs: update `CONTRIBUTORS.md`'
5058
commit-message: 'docs: update `CONTRIBUTORS.md`'
5159
delete-branch: true
@@ -70,7 +78,7 @@ jobs:
7078
token: ${{ secrets.GITHUB_TOKEN }}
7179
# Skipped workflows are still assigned a "success" status:
7280
status: success
73-
# This should be the correct commit SHA on the contributors-update branch:
81+
# This should be the correct commit SHA on ${{ env.BRANCH_NAME }}:
7482
sha: ${{ steps.create-pr.outputs.pull-request-head-sha }}
7583
# Name of status check to add/update:
7684
context: lint

0 commit comments

Comments
 (0)