Replies: 4 comments 3 replies
-
Has someone looked at this on github side? This seems like a very reasonable proposition that would probably help to reduce unwanted workflow runs over forks (which would probably save several thousands runs a day). Is there any chance we see this implemented? Thanks. |
Beta Was this translation helpful? Give feedback.
-
stop
…On Tue, Oct 25, 2022 at 8:29 AM Olivier Clavel ***@***.***> wrote:
Has someone looked at this on github side? This seems like a very
reasonable proposition that would probably help to reduce unwanted workflow
runs over forks (which would probably save several thousands runs a day).
Is there any chance we see this implemented?
Thanks.
—
Reply to this email directly, view it on GitHub
<#16109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWBSWJ3MU4NMW37DQUARQ6TWE7HDHANCNFSM5VGBBMIQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Do we have any solution to this request so far? Instead of skipping one/more jobs with if condition, need to skip the overall workflow. |
Beta Was this translation helpful? Give feedback.
-
We need a solution for that as well. @mkurz did you find any reasonablr workaround for this? I am thinking of making my workflow „workflow_dispatch” only on my main repository and then creating a new repository that will just contain a cron job that will trigger the on in main repostory on cron schedule. |
Beta Was this translation helpful? Give feedback.
-
When a repository gets forked, scheduled workflows will also run for the fork. This is not desired usually (at least this is my opinion). I guess there are thousands fo forks already which run scheduled workflows, occupying virtual machines and resources for nothing. Also it can get annoying if a scheduled job keeps failing for forks and users that forked such a repo get spammed with notifications that the (scheduled) workflow (of their forked repo) failed.
What can done right now is to check for the repo name to make sure a job is nailed to that repo, like done here:
However this is not a very good solution, since this condition has to be added to each job (besides that, it would be nice to not check for a repo name but if the repo is a fork or not, which is also not possible right now, see here and here).
So here is my suggestion how that should actually work:
or even more generic, checking for forks:
(of course that could be named differently, like
allow_forks
orrun_on_forks
, etc.)Or, even more generic 😉
What's better about these approches is IMHO that we don't have to care for each job to check for the repo (or fork) and just put the condition in one central place. Plus, it would be obvious that the jobs wouldn't even be tried to run, but instead the whole workflow would not even fire.
EDIT:
Somehow related: #12180, however that request is about to give users and orgs the possibilty to disallow (on a settings page) the execution of scheduled jobs. My request however gives the author of a workflow the power to define where a scheduled workflow is allowed to run.
Thanks for listening!
Beta Was this translation helpful? Give feedback.
All reactions