-
Notifications
You must be signed in to change notification settings - Fork 428
Add override for code scanning analysis of default branch #1603
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
Conversation
marcogario
left a comment
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
| } | ||
|
|
||
| // 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.
henrymercer
left a comment
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
henrymercer
left a comment
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