-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from ezzaze/master
Fix workflow action failing when json file was not changed
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]' | ||
|