• 欢迎加入MineBBS QQ讨论群:点击查看所有的官方讨论群
  • 我们将于近期对服务器进行迁移,服务可能中断至多2日。请各位安排好自己的访问计划,造成不便敬请谅解!
  • MineBBS入站考试已经上线!想要成为【正式会员】解锁更多功能吗?快来参与吧!【点我去看】

问题 GitHub Actions 定时任务无法触发

MaxLHy

【Lv:3】

正式会员
注册
2024/02/25
消息
112
金粒
3,054.69金粒
新创建(昨天创建)的仓库,.github/workflows 下放着 Actions 的 YAML 文件,设置的是北京时间 00:00 自动运行,然而 GitHub Actions 在那个时候并没有运行,今天尝试改成 5 分钟运行一次,也没有用。

YAML 文件:
[MD] ```yaml name: Sync SCLTK-Website on: workflow_dispatch: schedule: - cron: '0 16 * * *' permissions: contents: write jobs: sync: runs-on: ubuntu-latest steps: - name: Checkout current repository uses: actions/checkout@v7 with: token: ${{ secrets.GITHUB_TOKEN }} persist-credentials: true - name: Checkout SCLTK-Website uses: actions/checkout@v7 with: repository: MaxLHy0424/SCLTK-Website # 如需私有仓库,请取消注释并配置 PAT # token: ${{ secrets.PAT_TOKEN }} path: SCLTK-Website-Mirror # ref: main # 如需指定分支可取消注释 - name: Copy to 'public' folder run: | mkdir -p public rm -rf public/* cp -r SCLTK-Website-Mirror/. public/ rm -rf SCLTK-Website-Mirror rm -rf public/.git - name: Commit and push changes run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add public/ git diff --staged --quiet || git commit -m "Sync SCLTK-Website $(date +'%Y-%m-%d %H:%M:%S')" git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git git push ``` [/MD]
 

在线会员

  • 313455
  • LXING3156
  • mcmanzi
  • 健纲 黄
  • Ashsk
后退
顶部 底部