Skip to content

Scheduled update

Scheduled update #25

name: Scheduled update
on:
schedule:
- cron: '5 8 21 * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-python@v5
with:
cache: 'pip'
- uses: actions/setup-node@v4
with:
node-version: 20
- run: pip install rdflib requests
- run: python3 osm_wikidata.py
- run: npm install
- run: npm run build
- run: |
if [ $(git diff --name-only | wc -l) -gt 0 ]; then
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -am "Automated update"
git push
fi
env:
GH_TOKEN: ${{ github.token }}
tag:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10
- run: |
tag=$(git describe --tags --abbrev=0) || release_needed="true"
for file in $(git diff ${tag}..HEAD --name-only); do
if [ $file == "taginfo.json" ] || [ $file == "wikidata.json" ]; then
release_needed="true"
break
fi
done
if [ $release_needed == "true" ]; then
git tag $(jq -r '.version' package.json)
git push -u origin
gh release create $(jq -r '.version' package.json) --generate-notes
fi