githubtraining / exercise-scheduled-events

A hands-on exercise using GitHub Actions. See README.md for instructions on how to get started.
Creative Commons Attribution 4.0 International
1 stars 2 forks source link

Support all valid cron strings #3

Open hectorsector opened 3 years ago

hectorsector commented 3 years ago

Per feedback from an early tester:

My weekly failed with the following error: Warning: Expected stale-weekly to contain the cron syntax 0 0 MON, got 0 0 1. However, my syntax IS correct, I just chose to use the number not the name for the day of the week. It should not have failed.

We should support all valid answers, even if they're not what we expected. Perhaps there's a cron library we can use to validate the equivalency of two cron strings?

/cc @mattdavis0351

mattdavis0351 commented 3 years ago

I think we can easily fix this without a library! I'll take this one 😄

mattdavis0351 commented 3 years ago

@hectorsector want to close this out now that the above pr has 🚢 ?

hectorsector commented 3 years ago

If we want to leave the instructions as-is:

On your repository, edit the on: key of the stale-weekly.yml workflow so that it contains a trigger to run every Monday.

Then we'll need to support variations that all run weekly on a Monday. We can scope it down to a specific time on Monday so that the PR works, but as it stands if someone wants to input, say, at 3pm on a Monday their workflow will fail although still meeting the criteria @mattdavis0351

mattdavis0351 commented 3 years ago

So for that we will need to scope exactly how we want it and update the action accordingly. Let's leave this open until we get to that point

mattdavis0351 commented 3 years ago

@hectorsector I'm pretty certain we have addressed this. Should we close this issue?

hectorsector commented 3 years ago

I think this use case still wouldn't be addressed right @mattdavis0351 ?

if someone wants to input, say, at 3pm on a Monday their workflow will fail although still meeting the criteria

I can try and take a stab at it.