lovelyCARDINAL/WikiBots

View on GitHub
.github/workflows/Internal.yaml

Summary

Maintainability
Test Coverage
name: "[schedule] Internal"

on:
  schedule:
    - cron: "35 7 2 * *" # 2nd 15:35 CST
  workflow_dispatch:
    inputs:
      task:
        type: choice
        required: true
        options:
          - "override-category"

env:
  MOEGIRL_API_USER_AGENT: ${{ secrets.MOEGIRL_API_USER_AGENT }}
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  override-category:
    runs-on: ubuntu-latest
    if: |
      github.event_name == 'schedule' ||
      github.event.inputs.task == 'override-category'
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set Node Version
        uses: actions/setup-node@v4
        with:
          node-version: 20.x
          cache: "npm"
      - name: Install dependencies
        run: npm ci
      - name: Run Script
        env:
          ZH_IBOT: ${{ secrets.ZH_IBOT }}
        run: node src/Internal/updateOverrideCategory.js