lovelyCARDINAL/WikiBots

View on GitHub
.github/workflows/File.yaml

Summary

Maintainability
Test Coverage
name: "[schedule] File"
# src/File/info.js - 3x daily.yaml
# src/File/mainpageImages.js - 1x evening.yaml

on:
  schedule:
    - cron: "35 4 * * 4" # Thursday 12:35 CST
  workflow_dispatch:
    inputs:
      task:
        type: choice
        required: true
        options:
          - "revision-deletion"

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

jobs:
  revision-deletion:
    if: |
      github.event_name == 'schedule' || 
      github.event.inputs.task == 'revision-deletion'
    runs-on: ubuntu-latest
    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:
          CM_ABOT: ${{ secrets.CM_ABOT }}
        run: node src/File/revisionDelete.js