Skip to content

chore: reduce supply chain attack exposure - #45

Merged
alecgibson merged 1 commit into
masterfrom
supply-chain-hardening
Apr 2, 2026
Merged

alecgibson merged 1 commit into
masterfrom
supply-chain-hardening

Conversation

@alecgibson

Copy link
Copy Markdown

Summary

  • Add min-release-age=7 to .npmrc to avoid installing brand-new dependency releases
  • Use --min-release-age=0 in CI to allow Dependabot PRs to build immediately

See https://github.com/reedsy/reedsy-editor/pull/13717 for context.

Test plan

  • CI passes
  • npm install in CI uses --min-release-age=0 flag

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 2, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown

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 reduces exposure to supply-chain attacks by adding a minimum “release age” for newly published npm package versions in local installs, while allowing CI to bypass that delay so automated dependency update PRs can build immediately.

Changes:

  • Add min-release-age=7 to .npmrc to avoid installing very recent dependency releases by default.
  • Update the publish workflow to use npm install --min-release-age=0 for the local action build step.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.npmrc Enforces a 7-day minimum release age for dependency installs by default.
.github/workflows/publish.yml Overrides the minimum release age to 0 for the action dependency install in CI.

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

Comment thread .github/workflows/publish.yml Outdated
registry-url: 'https://npm.pkg.github.com'
- name: Build reencode action
run: cd ./.github/actions/reencode-dictionaries && npm install && cd ../../../
run: cd ./.github/actions/reencode-dictionaries && npm install --min-release-age=0 && cd ../../../

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

This step uses npm install inside .github/actions/reencode-dictionaries, but that directory includes a committed package-lock.json. In CI, npm ci is typically preferred because it installs strictly from the lockfile (more reproducible and avoids unintended lockfile updates) and is usually faster. Consider switching to npm ci while keeping the --min-release-age=0 override.

Suggested change
run: cd ./.github/actions/reencode-dictionaries && npm install --min-release-age=0 && cd ../../../
run: cd ./.github/actions/reencode-dictionaries && npm ci --min-release-age=0 && cd ../../../

Copilot uses AI. Check for mistakes.
- Add `min-release-age=7` to `.npmrc` to avoid installing brand-new dependency releases
- Use `--min-release-age=0` in CI to allow Dependabot PRs to build immediately

See reedsy/reedsy-editor#13717 for context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alecgibson
alecgibson force-pushed the supply-chain-hardening branch from b552efd to 568073b Compare April 2, 2026 15:08
@alecgibson
alecgibson merged commit 411b676 into master Apr 2, 2026
@alecgibson
alecgibson deleted the supply-chain-hardening branch April 2, 2026 15:09
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.

2 participants