-
Notifications
You must be signed in to change notification settings - Fork 17
45 lines (38 loc) · 1.34 KB
/
update-next-koma.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: "Update next-koma.json"
on:
schedule:
- cron: '0 8,20 * * *'
workflow_dispatch: {}
jobs:
update-next-koma:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Download raw json from the wiki
run: curl -o next-koma-raw.json --globoff "https://de.komapedia.org/api.php?origin=*&action=ask&format=json&query=[[Category:KoMa]][[ende::%3E$(date -I)]]|sort=KoMaNr|order=asc|limit=5|?Ort|?Beginn|?Ende"
- name: Preprocess json results
run: |
jq .query.results <next-koma-raw.json >next-koma.json
rm next-koma-raw.json
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: Sync next-koma.json from wiki
branch: update-next-koma-json
delete-branch: true
title: 'Update next-koma.json'
body: |
This is an automatically created PR.
The contents of `next-koma.json` was taken from the wiki.
labels: |
automated pr