-
Notifications
You must be signed in to change notification settings - Fork 10
37 lines (35 loc) · 1.14 KB
/
fetch_contributors.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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"