sort script still not running fine #249
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sort CSV Files | |
on: | |
push: | |
paths: | |
- 'source/**' | |
- 'tools/sort_lists.py' | |
jobs: | |
sort-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Check for changes in source folder | |
id: changed_files | |
run: | | |
changed_files=$(git diff --name-only HEAD~1 HEAD | grep -E '^source/') | |
echo "changed_files=$changed_files" >> $GITHUB_ENV | |
- name: Sort CSV files | |
if: env.changed_files | |
run: | | |
python tools/sort_lists.py | |
- name: Commit changes | |
if: env.changed_files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add source/ | |
git commit -m "Sort CSV files" -a | |
git push |