Repository navigation
59 lines (50 loc) · 1.87 KB
/
Copy pathupdate-contributors.yml
File metadata and controls
59 lines (50 loc) · 1.87 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Update Contributors
on:
pull_request:
types: [closed]
jobs:
update-contributors:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
- name: Update contributors
id: update
run: |
node .github/scripts/update-contributors.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_AUTHOR_EMAIL: ${{ github.event.pull_request.user.email }}
REPOSITORY: ${{ github.repository }}
- name: Check for changes
id: check
run: |
if git diff --quiet package.json; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: add ${{ github.event.pull_request.user.login }} to contributors"
title: "chore: add ${{ github.event.pull_request.user.login }} to contributors"
body: |
Automatically adding ${{ github.event.pull_request.user.login }} to the contributors list.
This PR was automatically created after their contribution was merged in PR #${{ github.event.pull_request.number }}.
🤖 Generated with [Claude Code](https://claude.ai/code)
branch: bot/add-contributor-${{ github.event.pull_request.user.login }}
delete-branch: true