Skip to content

Commit 869caf3

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

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/contributors.yml

Lines changed: 11 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,12 @@ 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+
git checkout master
32+
2633
# See https://github.com/marketplace/actions/auto-add-contributors for reference of the action.
2734
#
2835
# This action is not well documented, but it does the job for now. We pin the version in order
@@ -31,6 +38,7 @@ jobs:
3138
uses: BobAnkh/add-contributors@v0.2.2
3239
with:
3340
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
41+
BRANCH: ${{ env.BRANCH_NAME }}
3442
COMMIT_MESSAGE: 'docs: update `CONTRIBUTORS.md`'
3543
PATH: /CONTRIBUTORS.md
3644
CONTRIBUTOR: '## Contributors'
@@ -45,7 +53,8 @@ jobs:
4553
id: create-pr
4654
with:
4755
token: ${{ secrets.GITHUB_TOKEN }}
48-
branch: contributors-update
56+
base: master
57+
branch: ${{ env.BRANCH_NAME }}
4958
title: 'docs: update `CONTRIBUTORS.md`'
5059
commit-message: 'docs: update `CONTRIBUTORS.md`'
5160
delete-branch: true
@@ -70,7 +79,7 @@ jobs:
7079
token: ${{ secrets.GITHUB_TOKEN }}
7180
# Skipped workflows are still assigned a "success" status:
7281
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 }}:
7483
sha: ${{ steps.create-pr.outputs.pull-request-head-sha }}
7584
# Name of status check to add/update:
7685
context: lint

0 commit comments

Comments
 (0)