Skip to content

Conversation

Eynorey
Copy link
Contributor

@Eynorey Eynorey commented Sep 22, 2025

Related to #177.

This PR adds support for custom NPM registry configurations, allowing the action to install PNPM from there.

With this, the action copies a potential .npmrc into the destination directory from where PNPM runs self-install, respecting potential custom registry configurations.

# My custom registry
registry = https://my-registry.my-company.com/

Note

I was also considering an action parameter, but this feels more natural - if you are already using a custom registry via .npmrc, then you'll likely want your package manager to be fetched form there as well.

But I could also see a parameter being helpful for some setups, perhaps even acting as an override to the .npmrc registry configuration. Maybe as a follow-up?

Any feedback is greatly appreciated!

Copy link

@benquarmby benquarmby left a comment

Choose a reason for hiding this comment

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

❤️ Love this.

My opinion doesn't matter a great deal, but I'm going to give it anyway 😜

@Eynorey Eynorey force-pushed the support-custom-registry branch 2 times, most recently from 3ea717c to eee93a8 Compare September 22, 2025 21:23
@Eynorey
Copy link
Contributor Author

Eynorey commented Oct 6, 2025

@zkochan @KSXGitHub would you mind taking a look when you get a chance, thanks!

@Ellosaur
Copy link

Ellosaur commented Oct 7, 2025

I have an environment where using the public registry is not an option due to security constraints, so being able to configure this installation to use our private registry is essential so thanks for doing this!

Copy link
Collaborator

@KSXGitHub KSXGitHub left a comment

Choose a reason for hiding this comment

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

Alternatively, pnpm itself uses the package ini (with @types/ini for typing) to parse INI. That could be used instead of trying to reinvent the parser.

@KSXGitHub KSXGitHub requested a review from zkochan October 7, 2025 12:00
@zkochan
Copy link
Member

zkochan commented Oct 7, 2025

Just copy the .npmrc file from GITHUB_WORKSPACE to dest. Installation is performed by a pnpm version bundled with the action. It can read the .npmrc file.

copy .npmrc from GitHub workspace if it exists so that PNPM respects custom
registry configurations when self-installing
@Eynorey Eynorey force-pushed the support-custom-registry branch from eee93a8 to 0ca63ec Compare October 7, 2025 21:25
@Eynorey
Copy link
Contributor Author

Eynorey commented Oct 7, 2025

Thank you everyone for taking a look, and thank you for the feedback!

Just copy the .npmrc file from GITHUB_WORKSPACE to dest. Installation is performed by a pnpm version bundled with the action. It can read the .npmrc file.

That's so much more elegant, thank you for the suggestion!
Updated.

@zkochan zkochan merged commit 41ff726 into pnpm:master Oct 8, 2025
50 of 54 checks passed
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.

5 participants