Skip to content

Update README.md

Update README.md #24

name: Update Contributors List
on:
workflow_dispatch:
push: main
jobs:
update-contributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Update README with contributors
run: python src/fetch_contributors.py
- name: Commit and push if changed
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
PR_BRANCH="auto-pr-${GITHUB_SHA}"
git checkout -b $PR_BRANCH
git add README.md
git commit -m "Update contributors list" || exit 0
git push origin $PR_BRANCH
echo "PR_BRANCH=${PR_BRANCH}" >> $GITHUB_ENV
- name: Create Pull Request
id: create_pr
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --title "NOREF_update_list_of_contributors" --body "Fetch latest contributors"