-
Notifications
You must be signed in to change notification settings - Fork 39
49 lines (40 loc) · 1.17 KB
/
ensure-sorted.yml
File metadata and controls
49 lines (40 loc) · 1.17 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
name: Ensure lists are sorted
on:
pull_request:
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
tests:
name: Ensure Sorted Order
runs-on: ubuntu-latest
permissions:
contents: write
issues: read
pull-requests: read
checks: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.10'
- name: Sort file content order
run: |
python ./scripts/sorter.py
- name: Commit & Push Results, if needed
id: push_results
env:
HEAD_REF: ${{ github.head_ref }}
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "No files changed, nothing to do"
exit 0
fi
git config user.name 'Sorted Order Validation'
git config user.email '[email protected]'
git add '*.txt'
git commit -m "Auto sorting static files"
git push origin HEAD:${HEAD_REF}