Skip to content

Merge pull request #140 from alexander-san/master #18

Merge pull request #140 from alexander-san/master

Merge pull request #140 from alexander-san/master #18

Workflow file for this run

name: Sort JSON
on:
push:
branches:
- master
jobs:
sort-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Run JSON sorter
run: python ./.github/scripts/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'
git add airports.json
git commit -m 'Automatically sorted Airports JSON file'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}