question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Advice on handling scheduled event builds

See original GitHub issue

Hi @dorny,

We have a workflow containing multiple triggers:

  • push events (to the default branch)
  • pull requests (against the default branch)
  • workflow dispatch (i.e. manually-triggered)
  • scheduled events (i.e. cron)

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 error This 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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dornycommented, Jun 13, 2022

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:

  • By default, all files will be considered as changed - this will allow using the same job definition for scheduled events without any ifs. The most common usage of this action is for running tests, so running everything by default seems like a sensible default.
  • If base is specified:
    • if is different than the current branch, it will be used to do the comparison as usual
    • if it’s the same as the current branch, the changes from the last commit will be used

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.

0reactions
joehorsnellcommented, Jun 30, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Planning an Event Timeline: 4 Tips for Smooth Schedules
1. First schedule the non-negotiables · 2. Include your vendors' timing · 3. Iterate on your timeline draft, then do it again ·...
Read more >
Employee Scheduling Tips | 10 Techniques To Build Better ...
We've compiled our own list of employee scheduling tips to help you determine what practices you should implement to build a better schedule...
Read more >
How to Build Event Schedules that Make Sense for Vendors
Want to avoid annoyed vendors? Start here. Put yourself in his or her shoes. Say you're supposed to be on site to set...
Read more >
How to Make an Event Schedule - Eventbrite Blog
This will tell you how long you have to fit in speaker sessions, networking, breakout sessions and so on. When you know your...
Read more >
Project Schedules 101: Why You Need One and How to Make ...
Managing your project schedule, and all project assets, in a central location will help everyone have a single source of truth and ensure ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found