0

I am using this syntax to trigger workflow at the scheduled time only for prod branch.

on:
  schedule:
    - cron: "11 0 * * SAT"
    branches:
      - prod

But when I push the code it shows a syntax error:

You have an error in your yaml syntax on line 4

Any inputs? Does the schedule work with "branches" option?

  • As the error message says. You have a syntax error. `branches` is indented to the same level as `- cron`. It either needs to be moved back to the same level as `schedule` or prefixed with `- ` like the previous line, depending on what you are trying to do. (Then `- prod`) needs to be given the right level of indentation too. – Quentin Sep 30 '22 at 08:26

1 Answers1

1

You are trying to create a job on schedule, if you want to checkout your code, you have to use

actions/checkout@v2

Check for this article How do I trigger a scheduled action on a specific branch?

branches prod make sense only when you use on push or on pull_request.