Trigger Workflows¶
GitHub workflows are triggered by events.
Events related to a GitHub workflow include
- pull request
- push
- workflow_dispatch (Manual run)
- Schedule (Cron)
Scheduled Version Check
Scheduled Version Check GitHub workflow uses the cron schedule to check for newer versions of Clojure libraries and GitHub actions
Cron schedule¶
GitHub workflows can use cron: to define a schedule as to when a workflow should run.
A POSIX Cron pattern is used to define the schedule
- Minute [0,59]
- Hour [0,23]
- Day of the month [1,31]
- Month of the year [1,12]
- Day of the week ([0,6] with 0=Sunday)
name: "Scheduled Version Check"
on:
schedule:
- cron: "0 4 * * *" # at 04:04:04 ever day
# - cron: "0 4 * * 5" # at 04:04:04 ever Friday
# - cron: "0 4 1 * *" # at 04:04:04 on first day of month
Workflow Dispatch¶
Add workflow_dispatch: without arguments to the on: directive in a workflow configuration file to manually trigger the running of the workflow.
Visit GitHub.com > Actions > Workflow Name in the repository and select Run
Workflow with Manual Trigger
Conditional on another workflow¶
workflow_run: defines that a workflow should only run if the outcome of another GitHub workflow run completed with success.