Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github update dependencies fails with private registry #1006

Closed
eriklztiqqe opened this issue Aug 26, 2021 · 3 comments
Closed

Github update dependencies fails with private registry #1006

eriklztiqqe opened this issue Aug 26, 2021 · 3 comments

Comments

@eriklztiqqe
Copy link

We have multiple repositories, which have dependencies towards AWS CDK constructs in private npm registries (Github packages, later possibly Cloudsmith).

To access these constructs we thus need NPM_TOKEN exposed, but the update dependencies workflow does not include this, only GITHUB_TOKEN.
This causes the workflow to fail each time and we get an email notification about it. Currently, that includes about 13-14 repositories, and there will be more.

This is kind of related to #815, which also concerns the lack of exposed variables, but a different use case.

@jumic
Copy link
Contributor

jumic commented Sep 15, 2021

You can use workflowBootstrapSteps to add additional steps to your workflow. I used the following code snippet:

workflowBootstrapSteps: [{
  name: 'npmjs login',
  run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc',
  env: {
    NPM_TOKEN: '${{ secrets.NPM_TOKEN }}',
  },
}],

It creates file .npmrc including the NPM_TOKEN. In my example project I was able to use a private package from npm.js in my upgrade workflow.

@github-actions
Copy link
Contributor

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

@github-actions github-actions bot added the stale label Nov 15, 2021
@github-actions
Copy link
Contributor

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.

mergify bot pushed a commit that referenced this issue Jan 4, 2023
Fix #1799 #1006

Allow workflow setup steps to be used by extensions of node-project. 

This change will enable for example a step that sets NPM authentication for private repos before build and publish.

---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
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

No branches or pull requests

2 participants