Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 4

Combining on: push with on: schedule

Solved! Go to Solution.

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?

3 Replies
Solution
Copilot Lvl 2
Message 2 of 4

Re: Combining on: push with on: schedule

You can solve it with

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

 

GitHub Partner
Message 3 of 4

Re: Combining on: push with on: schedule

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

Copilot Lvl 3
Message 4 of 4

Re: Combining on: push with on: schedule

I was so close! Thank you