Delay GitHub Actions builds

Published:
Talks about: , , and

In order to delay the execution of an GitHub Action, use a mixture of the on: schedule: ... config, and a conditional build step.

name: <PIPELINE>
on:
  schedule:
    - cron: '<CRON>'
jobs:
  build:
    runs-on: <RUN_ON>
    steps:
      - name: Count commits in last week
        id: commits
        run: echo "::set-output name=count::$(git rev-list --count HEAD --since='<DATE>')"
      - name: Build project
        if: steps.commits.outputs.count > 0
        run: build-project