Skip to content

chore(cd): rm .npmrc creation and let actions/setup-node handle it - #96

Merged
saltenasl merged 3 commits into
mainfrom
ls/refactor-cd
Nov 1, 2025
Merged

saltenasl merged 3 commits into
mainfrom
ls/refactor-cd

Conversation

@saltenasl

@saltenasl saltenasl commented Nov 1, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Improved CI/CD pipeline to use automated authentication for npm package publishing, removing the previous manual auth step.
    • Added local npm auth file to project ignore rules to prevent leaking credentials and tidy repository configuration.

@saltenasl
saltenasl requested a review from a team as a code owner November 1, 2025 08:02
@coderabbitai

coderabbitai Bot commented Nov 1, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

CD workflow's npm authentication was changed: the publish job now sets NODE_AUTH_TOKEN from secrets.NPM_TOKEN at the job level so actions/setup-node handles auth. The previous explicit step that wrote an auth token to ~/.npmrc was removed. .gitignore was updated to ignore .npmrc.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant GitHubActions as GH Actions (cd job)
    participant SetupNode as actions/setup-node
    participant PublishAction as npm publish step
    Note over GitHubActions: OLD flow (removed)
    GitHubActions->>GitHubActions: checkout, build, extract package info
    GitHubActions->>GitHubActions: write auth token to ~/.npmrc (removed)
    GitHubActions->>PublishAction: run publish (uses ~/.npmrc)

    rect rgba(0,128,96,0.08)
    Note over GitHubActions,SetupNode: NEW flow (current PR)
    GitHubActions->>SetupNode: set NODE_AUTH_TOKEN (env from secrets.NPM_TOKEN)
    SetupNode->>GitHubActions: configures auth for npm actions
    GitHubActions->>PublishAction: run publish (auth via setup-node)
    end
Loading

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore(cd): rm .npmrc creation and let actions/setup-node handle it" directly and accurately reflects the main changes. The PR removes explicit .npmrc creation from the CD workflow and replaces it with NODE_AUTH_TOKEN environment variable, allowing actions/setup-node to manage authentication. The title is specific, clear, and sufficiently descriptive for developers scanning history to understand the refactoring intent without vagueness or noise.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b000166 and 169f5a4.

📒 Files selected for processing (1)
  • .gitignore (1 hunks)
🔇 Additional comments (1)
.gitignore (1)

2-2: Good: .npmrc addition aligns with workflow changes.

Adding .npmrc to .gitignore is the right call now that the publish job delegates npm authentication to actions/setup-node via the NODE_AUTH_TOKEN environment variable. This prevents accidental commits of generated auth files.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Nov 1, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.11%. Comparing base (11105a7) to head (4a615a9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #96   +/-   ##
=======================================
  Coverage   92.11%   92.11%           
=======================================
  Files          20       20           
  Lines         431      431           
  Branches      116      119    +3     
=======================================
  Hits          397      397           
  Misses         34       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 11105a7 and b000166.

📒 Files selected for processing (2)
  • .github/workflows/cd.yml (1 hunks)
  • .gitignore (1 hunks)
🔇 Additional comments (1)
.github/workflows/cd.yml (1)

18-20: No issues found.

setup-node v6 with registry-url automatically creates .npmrc referencing ${NODE_AUTH_TOKEN}. Your implementation is correct.

Comment thread .gitignore Resolved
@saltenasl
saltenasl merged commit 5be79b6 into main Nov 1, 2025
@saltenasl
saltenasl deleted the ls/refactor-cd branch November 1, 2025 08:20
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.

1 participant