Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/update-contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update Contributors

on:
push:
branches:
- main
workflow_dispatch: # Allows manual triggering

jobs:
update-contributors:
runs-on: ubuntu-latest
permissions:
contents: write # Needed for pushing changes
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Update contributors
run: npm run update-contributors
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check for changes
id: check-changes
run: |
if [[ -n "$(git status --porcelain README.md)" ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "No changes to README.md"
fi

- name: Commit and push changes
if: steps.check-changes.outputs.changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m "docs: update contributors list [skip ci]"
git push
Loading