Skip to content

Trigger Workflowsλ︎

GitHub workflows are triggered by events.

Events related to a GitHub workflow include

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

Scheduled version check uses cron schedule

Cron references

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

Conditional on other workeflowλ︎

Run a workflow based on the outcome of running another GitHub workflow

Run workflow if MegaLinter workflow returns success

    name: "Publish Documentation"
    on:
      # Run work flow conditional on linter workflow success
      workflow_run:
        workflows:
          - "MegaLinter"
        paths-ignore:
          - README.md
          - CHANGELOG.md
          - .gitignore
        branches:
          - main
        types:
          - completed