Skip to content

Commit

Permalink
Bot optimized the script, lets test it
Browse files Browse the repository at this point in the history
test v.1.0.a
  • Loading branch information
spirillen committed Jan 18, 2025
1 parent 4b4751e commit d79fa84
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/sort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@ jobs:
run: |
pip install --no-cache-dir -r "${{ github.workspace }}/requirements.txt"
- name: Sort the lists
- name: Check for changes in source folder
id: check_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^source/'; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
- name: Run Fates Script
if: env.changes == 'true'
continue-on-error: true
run: |
# sudo apt-get install -y fates
python3 tools/sort_lists.py
continue-on-error: true
- name: Configure Git
run: |
Expand All @@ -37,9 +48,14 @@ jobs:
git config --global --add safe.directory /github/workspace
- name: Commit changes
if: env.changes == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add .
git commit -m "Sorted files"
git push
if git diff --staged --quiet; then
echo "We are good, no changes to the sources"
else
git add .
git commit -m "Sorted files"
git push
fi

0 comments on commit d79fa84

Please sign in to comment.