Skip to content

Updated dependencies and block axios, got#95

Merged
jpolavar merged 5 commits intomainfrom
update-dependencies
Apr 2, 2026
Merged

Updated dependencies and block axios, got#95
jpolavar merged 5 commits intomainfrom
update-dependencies

Conversation

@jpolavar
Copy link
Copy Markdown
Contributor

Closes #94

@jpolavar jpolavar self-assigned this Mar 31, 2026
@jpolavar jpolavar added the MAJOR label Mar 31, 2026
@jpolavar jpolavar requested review from adcreare and lukebrdn March 31, 2026 16:52
@jpolavar
Copy link
Copy Markdown
Contributor Author

coverage step is comparing with main and is failing

Copy link
Copy Markdown
Contributor

@adcreare adcreare left a comment

Choose a reason for hiding this comment

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

We should block axios completely vs just banning the versions. Those are already unpublished from npm.

*/
const notAllowed: NotAllowed[] = [
// ['@aws-sdk/client-*', '>3.387.0', UNSTABLE], // example of an unstable package
['axios', '0.30.4 || >=1.14.1', SECURITY_RISK],
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.

We should ban axios completely.
I'd also add in got as an excluded not allowed dependency.

Blocking these versions isn't really meaningful as they've already been unpublished from npm.

@adcreare adcreare self-requested a review April 1, 2026 01:18
Copy link
Copy Markdown
Contributor

@adcreare adcreare left a comment

Choose a reason for hiding this comment

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

Oops - approved by mistake

Copilot AI review requested due to automatic review settings April 1, 2026 03:08
@jpolavar jpolavar requested a review from adcreare April 1, 2026 03:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates core dependencies/tooling for the GitHub Actions utilities package and expands the dependency allow/deny checks by fully blocking specific HTTP client libraries.

Changes:

  • Upgraded runtime/dev dependencies (incl. @actions/*) and bumped package version/Node engine requirement.
  • Added axios (and got) to the “not allowed” dependency list, with test coverage.
  • Ran broad formatting updates across action implementations and unit tests, and expanded CI to test Node 25.x.

Reviewed changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/validate-npm-package/validate-npm-package.ts Switches @actions/core import style and reformats; still runs npm/node via shell commands.
src/validate-npm-package/validate-npm-package.spec.ts Reformats tests; updates a package version used in validation.
src/publish-beta/validate-name-and-resource-length.ts Formatting-only refactor of function signatures/conditionals.
src/publish-beta/validate-name-and-resource-length.spec.ts Formatting-only changes.
src/publish-beta/publish.ts Formatting-only changes to .npmrc creation.
src/publish-beta/publish.spec.ts Formatting-only changes.
src/publish-beta/publish-beta.ts Formatting-only changes around copy/publish comment message.
src/publish-beta/package.ts Formatting-only changes around logging.
src/publish-beta/package.spec.ts Formatting-only changes.
src/publish-beta/files.ts Formatting-only changes.
src/publish-beta/files.spec.ts Formatting-only changes.
src/publish-beta/compile.ts Formatting-only changes.
src/prepare-beta/package.ts Formatting-only changes around logging.
src/prepare-beta/package.spec.ts Formatting-only changes.
src/perform-bundle/analyze.ts Formatting-only changes.
src/nocks/github.test.ts Formatting-only changes to nock setup.
src/github-api/index.ts Formatting-only changes.
src/github-api/index-reviews.spec.ts Formatting-only changes.
src/github-api/index-publish-comment.spec.ts Formatting-only changes.
src/github-api/index-context.spec.ts Formatting-only changes.
src/coverage-reporter/util.ts Formatting-only changes.
src/coverage-reporter/tabulate.ts Formatting-only changes.
src/coverage-reporter/tabulate.spec.ts Formatting-only changes.
src/coverage-reporter/lcov.spec.ts Formatting-only changes.
src/coverage-reporter/html.ts Formatting-only changes.
src/coverage-reporter/html.spec.ts Formatting-only changes.
src/coverage-reporter/get-changes.ts Reformats guard clause (still only calls setFailed without stopping).
src/coverage-reporter/delete-old-comments.ts Formatting-only changes.
src/coverage-reporter/coverage-reporter.ts Formatting-only changes.
src/coverage-reporter/comment.ts Formatting-only changes.
src/comment-npm-publish/comment-npm-publish.ts Formatting-only changes.
src/check-published/slack.ts Adds cause to thrown Error; formatting updates.
src/check-published/check-published.ts Formatting-only changes.
src/check-pr-reviews/check-pr-reviews.ts Formatting-only changes.
src/check-pr-reviews/check-pr-reviews.spec.ts Formatting-only changes.
src/check-label/check-label.ts Formatting-only changes.
src/check-label/check-label.spec.ts Formatting-only changes.
src/check-imports/packages-not-allowed.ts Adds full blocks for axios and got with a shared “security risk” reason.
src/check-imports/packages-not-allowed.spec.ts Adds assertions ensuring axios/got are fully blocked.
src/check-imports/package-lock-file-util.ts Formatting-only changes.
src/check-imports/package-lock-file-util.spec.ts Formatting-only changes.
src/check-imports/check-imports.ts Formatting-only changes.
package.json Bumps package version, dependency versions, and Node engine minimum.
.github/workflows/ci.yml Expands CI matrix to include Node 25.x.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// const UNSTABLE =
// 'Higher versions are unstable and break tests in Check Digit services. This can be removed from the Not Allowed list when stability improves.';

export const SECURITY_RISK = 'Security risk: contains remote access trojan';
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The reason string "Security risk: contains remote access trojan" is a very specific factual claim that will be surfaced in the thrown error message when this check fails. Unless you can reference a specific advisory (e.g., CVE/GHSA link) or internal policy doc, consider replacing this with a non-assertive reason (e.g., "Blocked by security policy") and linking to supporting guidance elsewhere.

Suggested change
export const SECURITY_RISK = 'Security risk: contains remote access trojan';
export const SECURITY_RISK = 'Blocked by security policy due to security concerns';

Copilot uses AI. Check for mistakes.
Comment on lines 19 to +21
// ['@aws-sdk/client-*', '>3.387.0', UNSTABLE], // example of an unstable package
['axios', '*', SECURITY_RISK],
['got', '*', SECURITY_RISK],
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The PR title/description mentions blocking axios, but this change also blocks got. If both are intended, please update the PR description (and/or linked issue) to reflect that; otherwise remove got from the fully-blocked list.

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +36
const execResult = await exec(
`npm view ${packageNameAndBetaVersion} --json`,
{ cwd: workFolder },
);
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

child_process.exec runs via a shell, and packageNameAndBetaVersion comes from an action input. Interpolating it directly into npm view ... creates a command-injection risk. Prefer execFile/spawn with an argument array and/or strictly validate the input against an allowlist pattern for npm package specifiers before executing.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is an existing code

Comment on lines +54 to 57
description:
'test project for validating a target library or service npm package',
...(packageJson.engine === undefined ? {} : { engine: packageJson.engine }),
type: 'module',
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The generated package.json uses the property name engine, but npm uses the standard engines field. As written, this likely won’t carry over the target package’s Node engine requirements into the validation project (and npm view typically returns engines, not engine). Consider renaming the interface property and emitted field to engines to match npm conventions.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is an existing code

Comment on lines +18 to 26
if (
!options.commit ||
options.baseCommit === undefined ||
options.baseCommit === ''
) {
setFailed(
`The base and head commits are missing from the payload for this ${githubContext.eventName} event.`,
);
}
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

When the base/head commits are missing you call setFailed(...) but continue execution. Consider returning early or throwing after setFailed so callers don’t proceed into the GitHub API call with invalid options.commit/options.baseCommit values (which will fail later and obscure the original message).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is an existing code

@jpolavar jpolavar changed the title Updated dependencies and added axios not allowed versions Updated dependencies and block axios, got Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

❌ PR review status - has 1 reviewer outstanding

Copy link
Copy Markdown
Contributor

@adcreare adcreare left a comment

Choose a reason for hiding this comment

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

LGTM

@jpolavar jpolavar merged commit fd6fb7c into main Apr 2, 2026
5 of 7 checks passed
@jpolavar jpolavar deleted the update-dependencies branch April 2, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updated dependencies and axios not allowed versions

4 participants