diff --git a/.github/workflows/sort_airports.yml b/.github/workflows/sort_airports.yml index 54c3fc1..225c29c 100644 --- a/.github/workflows/sort_airports.yml +++ b/.github/workflows/sort_airports.yml @@ -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 'github-actions@github.com'