Skip to content

Commit

Permalink
Merge pull request #130 from ezzaze/master
Browse files Browse the repository at this point in the history
Fix workflow action failing when json file was not changed
  • Loading branch information
mwgg authored Jul 20, 2024
2 parents 57b170c + e6a9feb commit a9210b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/sort_airports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ jobs:
- name: Run JSON sorter
run: python sort.py airports.json airports.json icao

- name: Check if airports.json file changed
id: file_changed
run: |
if git diff --exit-code airports.json; then
echo "File did not change"
echo "changed=false" >> $GITHUB_ENV
else
echo "File was changed"
echo "changed=true" >> $GITHUB_ENV
fi
- name: Commit and push changes
if: env.changed == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
Expand Down

0 comments on commit a9210b5

Please sign in to comment.