diff --git a/.github/actions/openstreetmap-buffers/action.yml b/.github/actions/openstreetmap-buffers/action.yml index 97fe4dc1..cf1f9372 100644 --- a/.github/actions/openstreetmap-buffers/action.yml +++ b/.github/actions/openstreetmap-buffers/action.yml @@ -8,9 +8,15 @@ inputs: runs: using: "composite" steps: + - name: Extract continent/country from input + id: extract-country + run: | + echo "continent=$(echo ${{ inputs.country }} | cut -d'/' -f1)" >> $GITHUB_OUTPUT + echo "country=$(echo ${{ inputs.country }} | cut -d'/' -f2)" >> $GITHUB_OUTPUT + shell: bash - name: Get current date - id: date - run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + id: get-date + run: echo "date=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT shell: bash - name: Cache result id: cache-buffers @@ -19,7 +25,7 @@ runs: path: | openstreetmap-lines-buffers.geojson openstreetmap-polygons-buffers.geojson - key: openstreetmap-buffers-${{ inputs.country }}-${{ steps.date.outputs.date }} + key: openstreetmap-buffers-${{ steps.extract-country.outputs.country }}-${{ steps.get-date.outputs.date }} - name: Download OpenStreetMap extract if: ${{ steps.cache-buffers.outputs.cache-hit != 'true' }} run: wget -O openstreetmap-latest.osm.pbf https://download.geofabrik.de/${{ inputs.country }}-latest.osm.pbf