Skip to content

feat(dotfiles): add npm registry auth via mise and macOS Keychain - #2

Merged
vegardx merged 1 commit into
mainfrom
feat/configure-npm-for-github-packages-github-com-dnb-ghe-com
Jun 17, 2026
Merged

feat(dotfiles): add npm registry auth via mise and macOS Keychain#2
vegardx merged 1 commit into
mainfrom
feat/configure-npm-for-github-packages-github-com-dnb-ghe-com

Conversation

@vegardx

@vegardx vegardx commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Configure npm to authenticate against GitHub Packages registries (github.com and dnb.ghe.com).

  • Add [env] block to mise config sourcing GITHUB_TOKEN and GHE_TOKEN from macOS Keychain at shell activation
  • Create ~/.config/npm/npmrc with auth tokens for both registries
  • Wire the new file into Ansible symlink + directory tasks

Manual steps

Before running the playbook, store PATs in macOS Keychain:

security add-generic-password -a "vegardx" -s "github-packages-token" -w "ghp_..."
security add-generic-password -a "vegardx" -s "ghe-packages-token" -w "ghp_..."

Copilot AI review requested due to automatic review settings June 17, 2026 11:15
@vegardx vegardx changed the title Configure npm for GitHub Packages (github.com + dnb.ghe.com) feat(dotfiles): add npm registry auth via mise and macOS Keychain Jun 17, 2026
@vegardx
vegardx merged commit 4a2856e into main Jun 17, 2026
1 check passed

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 aims to configure npm authentication for GitHub Packages on both github.com and dnb.ghe.com by sourcing tokens dynamically from macOS Keychain via mise, and deploying an npmrc via the dotfiles Ansible role.

Changes:

  • Adds a mise [env] block that retrieves GitHub Packages tokens from macOS Keychain at shell activation time.
  • Introduces an npmrc under ~/.config/npm/ intended to provide registry auth for two registries.
  • Extends the dotfiles Ansible role to create ~/.config/npm and symlink the npmrc into place.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
roles/dotfiles/tasks/main.yml Creates ~/.config/npm and symlinks the npmrc into ~/.config/npm/npmrc.
roles/dotfiles/files/config/npm/npmrc Adds npm auth token configuration for GitHub Packages registries.
roles/dotfiles/files/config/mise/config.toml Adds dynamic env var lookups to read tokens from macOS Keychain.

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

Comment on lines 119 to 123
- mise/config.toml
- npm/npmrc
- gh/config.yml
- ssl/zscaler.pem
- zed/settings.json
Comment on lines +1 to +2
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
//npm.pkg.dnb.ghe.com/:_authToken=${GHE_TOKEN}
@vegardx
vegardx deleted the feat/configure-npm-for-github-packages-github-com-dnb-ghe-com branch July 25, 2026 16:07
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