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

MaxLHy

【Lv:3】

正式会员
注册
2024/02/25
消息
115
金粒
4,589.19金粒
新创建(昨天创建)的仓库,.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]
 

在线会员

  • zbwuming
  • turtle_s_aming
  • Xiaoniu
  • 筑梦天空
  • Allison
  • 158138811
  • iris
  • 86505087
  • 邪神龙哥
  • Ha_bird
  • fengtang4819
  • 星闻道
  • 浪花
  • 诺诺noo
  • S3D8
  • CCCP1991
  • weqesadadadefdg
  • 为君独舞
  • 凭栏听雨
  • 未雨屏
...和 4 更多。
后退
顶部 底部