损坏的“cron” gh-action 工作流程

损坏的“cron” gh-action 工作流程

我编写了下面的 GitHub 操作工作流程作为练习。

name: Cron CI

# Controls when the workflow will run
on:
  # Triggers the workflow every day minutes
  schedule:
    - cron: "01 10 * * 6,7"
    - cron: "01 10 * * 1,2,3,4,5"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "cron"
  cron:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Runs a single command using the runners shell
      - name: Run working script

        if: github.event.schedule != '01 10 * * 1,2,3,4,5'
        run: echo "Wake up! Grab a brush and put a little makeup"

      - name: Run resting script
        if: github.event.schedule != '01 10 * * 1,2,3,4,5'
        run: echo "It's not time to make a change! Just relax, take it easy."

尽管对我来说似乎是正确的,但我收到了错误日志invalid cron attribute "01 10 * * 6,7"。你能帮我理解这个错误吗?

[1]https://github.com/trouchet/sappio/actions/runs/3807658008/workflow

答案1

我做了以下修改:

  1. 删除起始数字0
  2. 使用0as Sunday 而不是7

现在可以了!

相关内容