-
Notifications
You must be signed in to change notification settings - Fork 164
41 lines (34 loc) · 1.14 KB
/
update-contributors.yml
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
38
39
40
41
name: Update Contributors
on:
pull_request:
types: [closed] # Trigger when a PR is closed
jobs:
update-contributors:
if: github.event.pull_request.merged == true # Run only if the PR is merged
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Install dependencies
- name: Install Python requests library
run: python -m pip install requests
# Run the script to fetch contributors and update README
- name: Fetch contributors and update README
run: |
python Tools/fetch_contributors.py
# Commit and push changes
- name: Commit and push changes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "Update contributors list after PR merge"
git push