From 548f25b005e1a6eaddd2b82d82ce3c54a9848f8a Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Thu, 13 Mar 2025 23:40:20 -0400 Subject: [PATCH 1/2] Better git logic for updating contributors in readme --- .github/workflows/update-contributors.yml | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index 91dc5ba861f..2cc6e33c29e 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -24,26 +24,27 @@ jobs: - name: Install dependencies run: npm ci - - name: Update contributors - run: npm run update-contributors + - name: Update contributors and check for changes + run: | + npm run update-contributors + git diff --quiet README.md || echo "changes=true" >> $GITHUB_OUTPUT + id: check-changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check for changes - id: check-changes + + - name: Stage changes + if: steps.check-changes.outputs.changes == 'true' run: | - if [[ -n "$(git status --porcelain README.md)" ]]; then - echo "changes=true" >> $GITHUB_OUTPUT - else - echo "No changes to README.md" - fi - + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add README.md + git commit -m "docs: update contributors list [skip ci]" + - name: Create Pull Request if: steps.check-changes.outputs.changes == 'true' uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "docs: update contributors list" title: "Update contributors list" body: | Automated update of contributors list in README.md From b0ab8e07586b2a0f8e1b14f4c128f590a4926c0d Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Thu, 13 Mar 2025 23:44:28 -0400 Subject: [PATCH 2/2] Update .github/workflows/update-contributors.yml Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- .github/workflows/update-contributors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index 2cc6e33c29e..52e83b1c4ce 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -27,7 +27,7 @@ jobs: - name: Update contributors and check for changes run: | npm run update-contributors - git diff --quiet README.md || echo "changes=true" >> $GITHUB_OUTPUT + if git diff --quiet README.md; then echo "changes=false" >> $GITHUB_OUTPUT; else echo "changes=true" >> $GITHUB_OUTPUT; fi id: check-changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}