From 0c8c41c6d4e8e9cdf03c8c55118a2600ca225339 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 6 Feb 2025 23:42:31 +0100 Subject: [PATCH] Add ghostbike bot as action --- .../workflows/config/config_ghost-bikes.json | 24 +++++++++++++++++++ .../workflows/ghostbikebot_masto_bike.yml | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .forgejo/workflows/config/config_ghost-bikes.json create mode 100644 .forgejo/workflows/ghostbikebot_masto_bike.yml diff --git a/.forgejo/workflows/config/config_ghost-bikes.json b/.forgejo/workflows/config/config_ghost-bikes.json new file mode 100644 index 0000000..215f9cc --- /dev/null +++ b/.forgejo/workflows/config/config_ghost-bikes.json @@ -0,0 +1,24 @@ +{ + "cacheDir": "./cache", + "mastodonAuth": { + "url": "https://masto.bike/", + "dryrun": false, + "timeout": 60000 + }, + "actions": [ + + { + "contentWarning": "Ghost bikes", + "poiName": "ghost bike", + "poisName": "ghost bikes", + "report": { + "overpassQuery": "nwr[%22memorial%22=%22ghost_bike%22];", + "post": "As of {date}, #OpenStreetMap contained information about {total} #ghostBikes.\n\nA #ghostBike is a memorial in the form of a #bicycle painted white.\nIt remembers a cyclist that has been killed by a car and is located near the place of the accident.\n\nOpenStreetMap is a world-wide map that everyone can edit and reuse for free. https://mapcomplete.org/ghostbikes is an editable map based on OpenStreetMap with ghostbikes." + }, + "themeWhitelist": ["ghostbikes"], + "numberOfDays": 31, + "showTopContributors": true, + "showThankYou": false + } + ] +} diff --git a/.forgejo/workflows/ghostbikebot_masto_bike.yml b/.forgejo/workflows/ghostbikebot_masto_bike.yml new file mode 100644 index 0000000..43d7696 --- /dev/null +++ b/.forgejo/workflows/ghostbikebot_masto_bike.yml @@ -0,0 +1,24 @@ +on: + schedule: + - cron: "0 2 * * 1" + +jobs: + ghostbikebot_masto_bike: + runs-on: [ ubuntu-latest ] + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + cache: "npm" + cache-dependency-path: package-lock.json + + - name: install deps + run: npm ci + shell: bash + + - name: Create ghostbike overview + shell: bash + run: npm run start -- ./.forgejo/workflows/config/config_ghost-bikes.json ${{ secrets.GHOSTBIKEBOT_MASTO_BIKE }} \ No newline at end of file