-
Notifications
You must be signed in to change notification settings - Fork 335
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
Add override for code scanning analysis of default branch #1603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'd appreciate more 👀
src/actions-util.ts
Outdated
@@ -630,6 +630,10 @@ function removeRefsHeadsPrefix(ref: string): string { | |||
// Is the version of the repository we are currently analyzing from the default branch, | |||
// or alternatively from another branch or a pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor:
// Returns whether we are analyzing the default branch for the repository.
// For cases where the repository information might not be available (e.g., dynamic workflows), this can be forced by the environment variableCODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A minor comment in addition to Marco's doc suggestion.
src/actions-util.test.ts
Outdated
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "true"; | ||
t.deepEqual(await actionsutil.isAnalyzingDefaultBranch(), true); | ||
|
||
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "false"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move these tests up, or into a separate test
function, such that we're testing actionsutil.isAnalyzingDefaultBranch
without event.repository.default_branch
existing?
4147f0b
to
ffb4aa2
Compare
ffb4aa2
to
07d5a56
Compare
07d5a56
to
94cc1de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Thanks for the reviews! |
Provide an override for code scanning analyses of the default branch.
See internal linked issue for details.
Merge / deployment checklist