Search code examples
yamlworkflowgithub-actions

Trigger GitHub action manually and on schedule


I want to trigger GitHub action manually and on schedule but the following code produces and error

name: Update data

on: 
   workflow_dispatch
   schedule:
     - cron: "0 5 */30 * *"

I'm searching for the solution how to do it correctly and have both options.


Solution

  • you need a colon after workflow_dispatch.

    name: Update data
    
    on: 
       workflow_dispatch:
       schedule:
         - cron: "0 5 */30 * *"