Don't error in the unusual case that a file is on the search path#2660
Merged
henrymercer merged 2 commits intomainfrom Dec 19, 2024
Merged
Don't error in the unusual case that a file is on the search path#2660henrymercer merged 2 commits intomainfrom
henrymercer merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 23 out of 36 changed files in this pull request and generated no comments.
Files not reviewed (13)
- package.json: Language not supported
- queries/binary-planting.ql: Language not supported
- src/init-action.ts: Evaluated as low risk
- src/codeql.test.ts: Evaluated as low risk
- src/tar.ts: Evaluated as low risk
- src/init.ts: Evaluated as low risk
- src/actions-util.ts: Evaluated as low risk
- src/git-utils.ts: Evaluated as low risk
- lib/util.js: Evaluated as low risk
- src/analyze.ts: Evaluated as low risk
- lib/analyze.js: Evaluated as low risk
- lib/codeql.test.js: Evaluated as low risk
- lib/init-action.js: Evaluated as low risk
Comments suppressed due to low confidence (3)
src/util.ts:1197
- The function
isBinaryAccessibleshould handle the case where the binary is found but is not executable. Consider adding a check to ensure the binary is executable after finding it.
await io.which(binary, true);
lib/tar.js:51
- Ensure that the behavior of
io.whichwhen the binary is not found is covered by tests. This is critical to confirm that the new implementation does not introduce unexpected behavior.
const tar = await io.which("tar", true);
lib/actions-util.js:225
- The error message should be more descriptive and user-friendly. Consider providing guidance on how to install the
fileprogram.
throw new FileCmdNotFoundError(`The `file` program is required, but does not appear to be installed. Please install it: ${e}`);
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
angelapwen
approved these changes
Dec 19, 2024
Contributor
angelapwen
left a comment
There was a problem hiding this comment.
Looks good — also looks like your PR to safe-which is merged, so not sure if we want to just use that?
Contributor
Author
|
My thinking was that it makes slightly more sense to use |
This was referenced Dec 20, 2024
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.
In the unusual case that a file is on the search path, log a warning but don't throw.
I've accomplished this by switching our
whichimplementation to use the standard Actions one within@actions/iobut have also submitted a PR tosafe-which: chrisgavin/safe-which#14.Merge / deployment checklist