1

I write as an exercise the GitHub action workflow below.

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."

Although it seems correct to me, I receive the error log invalid cron attribute "01 10 * * 6,7". May you help me understand the error?

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

Kusalananda
  • 333,661

1 Answers1

2

I made following modifications:

  1. Remove the initial digit 0.
  2. Use 0 as Sunday instead of 7.

Now it works!

Kusalananda
  • 333,661