Skip to content

Random Cron

Random Cron #4743

Workflow file for this run

name: Random Cron
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 % 30))\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 main