From 869caf35ec304b2bef271d411bb65b0a707df9cc Mon Sep 17 00:00:00 2001 From: georglauterbach <44545919+georglauterbach@users.noreply.github.com> Date: Tue, 2 May 2023 20:52:54 +0200 Subject: [PATCH] ci: fix contributors workflow (again) (#3304) --- .github/workflows/contributors.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index 654cd557..499fbbbc 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -14,6 +14,7 @@ env: # Assign commit authorship to official Github Actions bot: GIT_USER: github-actions[bot] GIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + BRANCH_NAME: contributors-update jobs: add-contributors: @@ -23,6 +24,12 @@ jobs: - name: 'Checkout' uses: actions/checkout@v3 + - name: 'Checkout New Branch and Push It' + run: | + git checkout -b ${{ env.BRANCH_NAME }} + git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:${{ env.BRANCH_NAME }} + git checkout master + # See https://github.com/marketplace/actions/auto-add-contributors for reference of the action. # # This action is not well documented, but it does the job for now. We pin the version in order @@ -31,6 +38,7 @@ jobs: uses: BobAnkh/add-contributors@v0.2.2 with: ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}} + BRANCH: ${{ env.BRANCH_NAME }} COMMIT_MESSAGE: 'docs: update `CONTRIBUTORS.md`' PATH: /CONTRIBUTORS.md CONTRIBUTOR: '## Contributors' @@ -45,7 +53,8 @@ jobs: id: create-pr with: token: ${{ secrets.GITHUB_TOKEN }} - branch: contributors-update + base: master + branch: ${{ env.BRANCH_NAME }} title: 'docs: update `CONTRIBUTORS.md`' commit-message: 'docs: update `CONTRIBUTORS.md`' delete-branch: true @@ -70,7 +79,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} # Skipped workflows are still assigned a "success" status: status: success - # This should be the correct commit SHA on the contributors-update branch: + # This should be the correct commit SHA on ${{ env.BRANCH_NAME }}: sha: ${{ steps.create-pr.outputs.pull-request-head-sha }} # Name of status check to add/update: context: lint