Add override for code scanning analysis of default branch#1603
Merged
Conversation
marcogario
reviewed
Mar 23, 2023
marcogario
reviewed
Mar 23, 2023
Contributor
marcogario
left a comment
There was a problem hiding this comment.
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. | |||
Contributor
There was a problem hiding this comment.
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
reviewed
Mar 23, 2023
Contributor
henrymercer
left a comment
There was a problem hiding this comment.
Looks good. A minor comment in addition to Marco's doc suggestion.
src/actions-util.test.ts
Outdated
Comment on lines
+230
to
+233
| process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "true"; | ||
| t.deepEqual(await actionsutil.isAnalyzingDefaultBranch(), true); | ||
|
|
||
| process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "false"; |
Contributor
There was a problem hiding this comment.
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
Contributor
Author
|
Thanks for the reviews! |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provide an override for code scanning analyses of the default branch.
See internal linked issue for details.
Merge / deployment checklist