| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…nalyzing the default branch.
There was a problem hiding this comment.
Thanks for finding and fixing!
Sorry, something went wrong.
| if (process.env.GITHUB_EVENT_NAME === "schedule") { | ||
| defaultBranch = removeRefsHeadsPrefix(getRequiredEnvParam("GITHUB_REF")); | ||
| } |
There was a problem hiding this comment.
A bit late on this, but aren't we guaranteed to be running on the default branch if we are in a scheduled run?
if (process.env.GITHUB_EVENT_NAME === "schedule") {
return true;
}
Sorry, something went wrong.
There was a problem hiding this comment.
No, because you can always check out and analyze whatever you want. e.g. you could analyze all your release branches.
Sorry, something went wrong.
There was a problem hiding this comment.
Good point!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
When running on a schedule, the event payload does not contain any repository information such as the default branch name. This means we incorrectly say that we're not analyzing the default branch when we actually are.
Fortunately we know that when running on a schedule the event is triggered against the default branch, hence the default branch is in GITHUB_REF.
Note it's not quite sufficient to assume that just because the event was schedule we're analyzing the default branch though. The user may have configured the workflow to check out and analyze a different branch. Therefore we cannot just always return true when we're running on a schedule, we do have to still compare GITHUB_REF against any user-provided ref input.
Merge / deployment checklist