-
Notifications
You must be signed in to change notification settings - Fork 49
44 lines (35 loc) · 1.02 KB
/
format-check.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
40
41
42
43
44
name: Format Check
on:
pull_request:
branches:
- main
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pypinyin
- name: Run format check
run: python scripts/format_teams.py
- name: Install dos2unix
run: sudo apt-get install -y dos2unix
- name: Convert files to Unix format
run: |
dos2unix data/teams.csv
dos2unix data/teams_formatted.csv
- name: Compare files
run: |
if ! diff -q data/teams.csv data/teams_formatted.csv; then
echo "Format check failed. Please run 'python scripts/format_teams.py' to fix the formatting issues."
exit 1
else
echo "Format check passed."
fi