FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Don't error in the unusual case that a file is on the search path by henrymercer · Pull Request #2660 · github/codeql-action · GitHub

Don't error in the unusual case that a file is on the search path - #2660

Merged
henrymercer merged 2 commits into
mainfrom
henrymercer/fix-error-file-on-path
Dec 19, 2024
Merged

Don't error in the unusual case that a file is on the search path#2660
henrymercer merged 2 commits into
mainfrom
henrymercer/fix-error-file-on-path

Conversation

Copy link
Copy Markdown
Contributor

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 which implementation to use the standard Actions one within @actions/io but have also submitted a PR to safe-which: chrisgavin/safe-which#14.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Copilot AI review requested due to automatic review settings December 19, 2024 14:47
henrymercer requested a review from a team as a code owner December 19, 2024 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 isBinaryAccessible should 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.which when 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 file program.
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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good — also looks like your PR to safe-which is merged, so not sure if we want to just use that?

Copy link
Copy Markdown
Contributor Author

My thinking was that it makes slightly more sense to use @actions/io for consistency with other first-party Actions, but I don't think there's a huge difference.

henrymercer merged commit d01b25e into main Dec 19, 2024
henrymercer deleted the henrymercer/fix-error-file-on-path branch December 19, 2024 17:51
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL