Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Can't publish to npm #7

Open
kamilbiela opened this issue Apr 16, 2020 · 2 comments
Open

Can't publish to npm #7

kamilbiela opened this issue Apr 16, 2020 · 2 comments

Comments

@kamilbiela
Copy link

kamilbiela commented Apr 16, 2020

Hi,

Im trying to use your github action to publish to npm without luck:
action log: https://github.com/kamilbiela/cdk-sqs-monitored/runs/593279090?check_suite_focus=true

gh action workflow: https://github.com/kamilbiela/cdk-sqs-monitored/blob/e59b5f740146241eda68abf646c1f5c52d2915d7/.github/workflows/nodejs.yml

Using just npm publish in github action seems to be working, so secret should be ok:
https://github.com/kamilbiela/cdk-sqs-monitored/runs/580649859?check_suite_focus=true

I'm not sure what I'm doing wrong here :/

@udondan
Copy link
Owner

udondan commented Apr 17, 2020

Hi Kamil,

I forked your repo and played a bit with it. The problem is this line: https://github.com/kamilbiela/cdk-sqs-monitored/blob/5934e7460c012d8bccd5aba67e96c5c067008de1/.github/workflows/nodejs.yml#L23

The actions/setup-node action sets authentication information in the environment, if the registry-url option is set. The jsii-publish action defines the auth info in a file. The env definition has precedence over the file and therefore the NPM_TOKEN is never used.

I should probably also use the env approach or unset the env before the publish action. Thanks for letting me know about this.

In the meantime you can just remove the registry-url option. I think it only makes a difference if you want to publish directly via npm publish anyway.

Let me know if that works.

Cheers,
Daniel

@kamilbiela
Copy link
Author

Removing registry-url fixes the issue, thank you very much :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants