Generate updated ZSM branch #6
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
name: Generate ZSM Pull Request | |
on: | |
workflow_dispatch: | |
inputs: | |
ZSM_URL: | |
description: 'URL to the ZSM .kml file' | |
required: true | |
default: 'https://www.stac.aviation-civile.gouv.fr/sites/default/files/france_1.kml' | |
jobs: | |
Download-Convert-ZSM-File: | |
name: Download and convert ZSM file | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🚚 Get latest code | |
uses: actions/checkout@v4 | |
with: | |
path: 'airspace' | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
# - name: Create and checkout new branch | |
# run: | | |
# current_date=${{ steps.date.outputs.date }} | |
# git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
# git config --global user.name "github-actions[bot]" | |
# git checkout -b autogenerated/zsm-$current_date | |
# git push origin -u autogenerated/zsm-$current_date | |
- name: Download and convert ZSM file | |
id: download-convert | |
run: | | |
current_date=${{ steps.date.outputs.date }} | |
echo "## Install openaip-openair-parser" | |
git clone https://github.com/llauner/kml2OpenAir.git | |
cd kml2OpenAir | |
npm install | |
echo "## Downloading and converting kmlfile ...: ${{ github.event.inputs.ZSM_URL }}" | |
node ./main.js ${{ github.event.inputs.ZSM_URL }} ../zsm_openair.txt | |
cd ../airspace | |
git pull | |
- name: ⚙️ Push .kml + .kmz to repo | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
repository: ./airspace | |
commit_message: "Add ZSM file for ${{ steps.date.outputs.date }}" | |
branch: autogenerated/zsm-${{ steps.date.outputs.date }} | |
create_branch: true | |
file_pattern: 'zsm_openair.txt' |