Combining on: push with on: schedule

Is it possible to have a workflow that runs both on push and on schedule?

Basically I have a workflow that I want to run on each commit but also nightly to make sure integration tests still run successfully. I have some volatile dependencies so stuff can break overnight.

Currently I have two copy-pasted workflow but with different “on” value. Is there any way to combine them?

You can solve it with

on:
  push:
  schedule:
    - cron: '* * * * *'
3 Likes

Just reminder, the shortest interval you can run scheduled workflows is once every 5 minutes.

3 Likes

I was so close! Thank you