Skip to content

chore(ci): npm-publish via reusable workflows#75

Open
sheplu wants to merge 1 commit into
masterfrom
ci-workflows
Open

chore(ci): npm-publish via reusable workflows#75
sheplu wants to merge 1 commit into
masterfrom
ci-workflows

Conversation

@sheplu

@sheplu sheplu commented Jan 3, 2026

Copy link
Copy Markdown
Member

Publish workflow based on the new staged published - with additional security from npmrc

@sheplu sheplu marked this pull request as draft January 4, 2026 06:44
@sheplu sheplu force-pushed the ci-workflows branch 2 times, most recently from aeaa8de to c8689b6 Compare June 10, 2026 18:49
@sheplu sheplu requested a review from UlisesGascon June 10, 2026 18:50
@sheplu sheplu force-pushed the ci-workflows branch 5 times, most recently from 5ff0a3c to ee4ddf0 Compare June 10, 2026 19:23
@sheplu sheplu marked this pull request as ready for review June 10, 2026 19:25

@UlisesGascon UlisesGascon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am happy with the idea, just let's remove all the npm install and run scripts as are not critical for the publication step 👍

Comment on lines +15 to +67
audit:
name: Audit production dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "lts/*"

- name: Audit production dependencies
run: npm audit --omit=dev

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "lts/*"

- name: Install dependencies
run: npm install --ignore-scripts --include=dev

- name: Run lint
run: node --run lint

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "lts/*"

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
audit:
name: Audit production dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "lts/*"
- name: Audit production dependencies
run: npm audit --omit=dev
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install --ignore-scripts --include=dev
- name: Run lint
run: node --run lint
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test

To be honest when I publish locally I don't run scripts or install dependencies (unless it is strict requirement like a build process for typescript, etc...). Avoiding that also in the CI we reduce noice and attack surface. We can assume that once a release is created in the repo the source code is stable to ship.

Also audit dependencies is not that relevant as this stage as we don't ship the lockfile, so that audit report won't be idempotent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

there is pro and con at this here - on my side by having the publish job separe and not using any specific install would prevent any issues while still ensuring that something is not breaking. wdyt?

Comment thread .github/workflows/npm-publish.yml Outdated
Comment on lines +91 to +92
- name: Install dependencies
run: npm install --ignore-scripts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- name: Install dependencies
run: npm install --ignore-scripts

We can skip this :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed

Comment thread .npmrc Outdated
allow-git=none
allow-directory=none

min-release-age=2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
min-release-age=2
min-release-age=7

I will go for a week, if something is really urgent or critical we will notice and always can manually upgrade. Given the amount of volume in the recent supply chain attacks maybe 2d won't be sustainable long term (specially on large holidays period). One week seems solid IMO

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

changed to 7

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