Skip to content

随机定时运行 #4751

随机定时运行

随机定时运行 #4751

Workflow file for this run

name: 随机定时运行
on:
workflow_run:
workflows: ["刷步数"]
types:
- completed
jobs:
repo-sync:
runs-on: ubuntu-latest
timeout-minutes: 3
if: github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }} #此处PAT需要申请,教程详见:https://www.jianshu.com/p/bb82b3ad1d11,需要repo和workflow权限
- name: random cron
run: |
sed -i -E "s/(- cron: ')[0-9]+( [^[:space:]]+ \* \* \*')/\1$(($RANDOM % 10))\2/g" .github/workflows/run.yml
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "random cron."
git push origin master