Skip to content

Commit fe2ec42

Browse files
authored
Add a GitHub workflow to ensure directory sorting (#1015)
1 parent 17d6682 commit fe2ec42

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check Dictionary Sorting
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
sort-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.x"
17+
- name: Sort dictionaries
18+
run: |
19+
for file in data/dictionary/*.txt; do
20+
python3 data/scripts/sort.py "$file"
21+
done
22+
- name: Verify no diff
23+
run: |
24+
if ! git diff --exit-code; then
25+
echo "Dictionary files are not sorted. Run: python3 data/scripts/sort.py data/dictionary/*.txt"
26+
exit 1
27+
fi

0 commit comments

Comments
 (0)