-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advice on handling scheduled event builds #100
Comments
PS. Thanks for building this GH Action, it's great 👍. |
Hi @joehorsnell, What exactly do you expect from handling the situation without raising the error? |
Hi @dorny, thanks for getting back to me. I think ideally it would just use the latest commit on whatever branch the scheduled build was triggered for, much like for a build on the default branch (main/master)? |
Assuming you run the build on a daily basis, it would actually make sense to compare the current version against the last commit from the past day. For example, you could find the commit ID like this:
This is something I would prefer to not include directly in this action. |
I'm not sure that behaviour is too intuitive to be honest - the schedule is defined by a cron, which could be any frequency at all. There is nothing to accurately tie the time a build runs with a particular commit (i.e. the cron schedule is a request to run at a certain time, but it could be delayed, as documented here). What I'm suggesting is just having a sensible default for scheduled builds, so that rather than causing an error, it works in the same way as a build for a branch push does - i.e. take the latest commit for the branch that the build is running for and use that to calculate the diff? Is there a way I can set that myself just for scheduled builds, without breaking the existing behaviour for the other triggers? Thanks! |
I had this error too. How would I always consider scheduled builds as all new? |
Related to dorny#100 (can't say it fixes it, but at least clarifies usage), this PR adds a section to the docs to explain how to handle using this action in a workflow triggered by a [`schedule` event][1]. [1]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
@jlarmstrongiv - FYI I opened #120 to update the docs and clarify usage around scheduled events. |
Related to dorny#100 (can't say it fixes it, but at least clarifies usage), this PR adds a section to the docs to explain how to handle using this action in a workflow triggered by a [`schedule` event][1]. [1]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
We are trying to do that at https://github.com/airbytehq/airbyte and also running into this issue. It'll be great if this action can detect the scheduled event and default to the last commit on master. |
Sorry for the delay, I've been quite busy the last few months. IMHO, there's not much use for this action with scheduled events. At the same time, it should not stay in the way and complicate the workflow definitions more than necessary. So, I've come to the conclusion:
This way it should support both behaviors that were proposed in this issue. I will make it part of the next release later this month or so. I haven't gone through all the reported issues yet, so depends on what I will find there. |
Hi @dorny - yep, agreed, I think the best thing is for this action to just consider everything as having changed for a scheduled event. If people want specific behaviour for scheduled events, they can always do that, but the main thing is just having it not cause an error on that event type. |
I would also like this behavior where the scheduled jobs just run everything. Basically the goal of those is to ensure everything is still working with all of our newest external dependencies. So we want to run all jobs. I would also like an option to run all jobs for pushes, but not PRs. So the PR workflow is faster but all pushes run all tests. Is that something that is possible to accomplish today? I don't know if this could just be generalized so you could list the event types for which you want all outputs to be true? Edit: Actually I realized I could probably just customize my |
Hi @dorny,
We have a workflow containing multiple triggers:
Your
paths-filter
action works great for the first three use-cases, detecting the context and base to compare against. However, it fails for scheduled events giving the errorThis action requires 'base' input to be configured or 'repository.default_branch' to be set in the event payload
.Looking in your code at where the error is thrown, we could set a
base
, but I'm not sure how to set that in a way that would work for the other triggers.Any suggestions on how to handle this? For a scheduled build there is obviously no "base" to compare against as it's just a specific commit that is used, but ideally it would fall-back and handle this situation without raising an error?
Thanks,
Joe.
The text was updated successfully, but these errors were encountered: