Skip to content

[daily] 1x

[daily] 1x #1070

Workflow file for this run

name: "[daily] 1x"
# 0
## Personal/watch.js
## Clean/purge.js
## File/mainpageImages.js
## Cateorgy/fixRedirect.js
# 4
## Clean/sandbox.js
## Clean/brokenRedirectDelete.js
## Activity/maintainer.js
# 6
## Clean/urlUnquote.js
on:
schedule:
- cron: "35 16 * * *" # 00:35 CST
- cron: "50 20 * * *" # 04:50 CST
- cron: "35 1 * * *" # 09:35 CST
workflow_dispatch:
inputs:
task:
type: choice
required: true
options:
- "watch"
- "purge"
- "mainpage-image-protection"
- "fix-redirect-category"
- "clean-sandbox"
- "broken-redirect-deletion"
- "check-activities"
- "url-unquote"
env:
MOEGIRL_API_USER_AGENT: ${{ secrets.MOEGIRL_API_USER_AGENT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
watch:
if: |
github.event.schedule == '35 16 * * 0' ||
github.event.inputs.task == 'watch'
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:
ZH_MAIN: ${{ secrets.ZH_MAIN }}
run: node src/Personal/watch.js
purge:
if: |
github.event.schedule == '35 16 * * *' ||
github.event.inputs.task == 'purge'
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:
ZH_ABOT: ${{ secrets.ZH_ABOT }}
run: node src/Clean/purge.js
mainpage-image-protection:
needs: purge
if: |
github.event.schedule == '35 16 * * *' && needs.purge.result == 'success' ||
github.event.inputs.task == 'mainpage-image-protection'
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:
ZH_ABOT: ${{ secrets.ZH_ABOT }}
CM_ABOT: ${{ secrets.CM_ABOT }}
run: node src/File/mainpageImages.js
fix-redirect-category:
needs: mainpage-image-protection
if: |
github.event.schedule == '35 16 * * *' && needs.mainpage-image-protection.result == 'success' ||
github.event.inputs.task == 'fix-redirect-category'
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:
ZH_BOT: ${{ secrets.ZH_BOT }}
CM_BOT: ${{ secrets.CM_BOT }}
run: node src/Category/fixRedirect.js
clean-sandbox:
if: |
github.event.schedule == '50 20 * * *' ||
github.event.inputs.task == 'clean-sandbox'
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:
ZH_ABOT: ${{ secrets.ZH_ABOT }}
run: node src/Clean/sandbox.js
broken-redirect-deletion:
if: |
github.event.schedule == '50 20 * * *' ||
github.event.inputs.task == 'broken-redirect-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:
ZH_ABOT: ${{ secrets.ZH_ABOT }}
run: node src/Clean/brokenRedirectDelete.js
check-activities:
needs: [clean-sandbox, broken-redirect-deletion]
if: |
github.event.schedule == '50 20 * * *' && needs.clean-sandbox.result == 'success' && needs.broken-redirect-deletion.result == 'success' ||
github.event.inputs.task == 'check-activities'
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:
ZH_IBOT: ${{ secrets.ZH_IBOT }}
CM_IBOT: ${{ secrets.CM_IBOT }}
run: node src/Activity/maintainer.js
url-unquote:
if: |
github.event.schedule == '35 1 * * *' ||
github.event.inputs.task == 'url-unquote'
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:
ZH_IBOT: ${{ secrets.ZH_IBOT }}
CM_IBOT: ${{ secrets.CM_IBOT }}
run: node src/Clean/urlUnquote.js