Skip to content

Conversation

@theengineear
Copy link
Collaborator

Doing this improves our security as it relates to publishing to NPM from GitHub. These changes relate to #326.

Additionally:

  • Stop calling npm ci during publish, it’s a known attack vector and we shouldn’t actually need it in our no-build repository.
  • Bump GitHub actions dependencies to “@v6”.

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/checkout@v6
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doing some due diligence.

with:
node-version: '22.14'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this was probably just copied at one point. This project doesn’t even have production dependencies and it has no build… so I don’t know why we’d need to run npm ci. This should theoretically reduce attack vector surface area, fwiw.

jobs:
main:
runs-on: ubuntu-latest
environment: npm-publish
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Key change: We now run this action within an assumed environment (yet to be created). It’s called npm-publish here to differentiate between other ways we publish (e.g., JSR). I.e., publish did not feel sufficient enough.

wesleytodd
wesleytodd previously approved these changes Dec 4, 2025
Doing this improves our security as it relates to publishing to NPM from
GitHub. These changes relate to #326.

Additionally:
- Stop calling `npm ci` during publish, it’s a known attack vector and
  we shouldn’t actually need it in our no-build repository.
- Bump GitHub actions dependencies to “@v6”.
@theengineear theengineear force-pushed the use-github-environment branch from 8d4093a to 831c2ff Compare December 4, 2025 23:45
@theengineear theengineear merged commit c332566 into main Dec 4, 2025
1 check passed
@theengineear theengineear deleted the use-github-environment branch December 4, 2025 23:46
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