-
Notifications
You must be signed in to change notification settings - Fork 17.2k
39 lines (39 loc) · 1.25 KB
/
run-sort-users-script.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
name: run-python-sort-script
on: pull_request
jobs:
build:
name: Run sort-users.py
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Sort users
run: python sort-users.py
- name: Change CONTRIBUTORS file
run: |
echo "Changed" > CONTRIBUTORS.md
- name: Check for changes
uses: tj-actions/verify-changed-files@v17
id: changed_files
with:
files: |
CONTRIBUTORS.md
- name: Display changes to CONTRIBUTORS file
if: steps.changed_files.outputs.files_changed == 'true'
run: |
echo "Changed files: ${{ steps.changed_files.outputs.changed_files }}"
- name: Commit changes
if: steps.changed_files.outputs.files_changed == 'true'
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git checkout -B ${{ github.event.pull_request.head.ref }}
git commit -a -m "(CI) format code"
git push origin ${{ github.event.pull_request.head.ref }}