Skip to content

Run wiki bot

Run wiki bot #84

Workflow file for this run

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@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup npm
run: npm install -g npm@10
- name: Cache Node.js modules
uses: actions/cache@v4
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@v6
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