Skip to content

Merge pull request #1630 from RooVetGit/contributors #1

Merge pull request #1630 from RooVetGit/contributors

Merge pull request #1630 from RooVetGit/contributors #1

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