-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (56 loc) · 2.24 KB
/
run-wiki-bot.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Run wiki bot
on:
schedule:
- cron: '0 12 * * 5'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
wiki-bot:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup npm
run: npm install -g npm@10
- name: Cache Node.js modules
uses: actions/cache@v3
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install dependencies
run: npm ci
- name: Run wiki-bot
working-directory: ${{github.workspace}}/tools/wiki-bot
run: npm start -- --update
- name: Detect changes in data and assets folder
id: changes
run: echo "changed=$(git diff --quiet --stat HEAD -- ./src/data ./src/assets || echo 'true')" >> $GITHUB_OUTPUT
- name: Create Pull Request
# Create PR only if there are changes in the src/data or src/assets folder otherwise skip
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.WIKI_BOT_TOKEN }}
title: Wiki bot update
body: Updates data extracted from [wiki.dominionstrategy.com](https://wiki.dominionstrategy.com/)
add-paths: |
src/data/**/*
src/assets/**/*
tools/wiki-bot/last-generation.json
commit-message: 'chore: update data/assets build with WikiBot'
branch: wiki-bot-update
branch-suffix: timestamp
delete-branch: true
labels: |
wiki bot
enhancement
assignees: GagaMen,TobiDimmel