1- name : PR Conference Sort
1+ name : Pull Request Conference Sort & All-contrib
22
33on :
44 pull_request :
55 paths :
66 - ' _data/conferences.yml'
77
88jobs :
9- validate-and- sort :
9+ sort :
1010 runs-on : ubuntu-latest
11- permissions :
12- contents : write
13- pull-requests : write
14-
1511 steps :
1612 - name : Checkout repository
1713 uses : actions/checkout@v4
@@ -25,15 +21,40 @@ jobs:
2521 - name : Run sort command
2622 run : pixi run sort
2723
28- - name : Check for changes
29- id : git-check
24+ - name : Check and commit sort changes
3025 run : |
31- git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
26+ if ! git diff --exit-code; then
27+ git config --global user.name 'github-actions[bot]'
28+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
29+ git add _data/*
30+ git commit -m "chore: sort conferences"
31+ git push
32+ fi
33+
34+ add-contributor :
35+ runs-on : ubuntu-latest
36+ needs : sort
37+ steps :
38+ - name : Checkout repository
39+ uses : actions/checkout@v4
40+ with :
41+ ref : ${{ github.event.pull_request.head.ref }}
42+ repository : ${{ github.event.pull_request.head.repo.full_name }}
43+
44+ - name : Setup Pixi
45+ uses :
prefix-dev/[email protected] 3246
33- - name : Commit changes to PR
34- if : steps.git-check.outputs.changes == 'true'
47+ - name : Add contributor and commit if changed
3548 run : |
36- git config --global user.name 'github-actions[bot]'
37- git config --global user.email 'github-actions[bot]@users.noreply.github.com'
38- git commit -am "chore: sort conferences"
39- git push
49+ PR_AUTHOR="${{ github.event.pull_request.user.login }}"
50+
51+ pixi run install
52+ pixi run add $PR_AUTHOR conference
53+
54+ if ! git diff --exit-code; then
55+ git config --global user.name 'github-actions[bot]'
56+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
57+ git add .all-contributorsrc README.md CONTRBUTING.md
58+ git commit -m "docs: add $PR_AUTHOR as contributor for conferences"
59+ git push
60+ fi
0 commit comments