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

Move .npmrc write out of actions #612

Merged
merged 3 commits into from
Apr 5, 2023

Conversation

CobyPear
Copy link
Member

@CobyPear CobyPear commented Apr 5, 2023

What changes were made?

  • Add registry string to .npmrc
  • Remove write of .npmrc from the Actions workflows
  • Add NPM_TOKEN to action env to be read by the .npmrc during the action

Where were the changes made?

.npmrc and GitHub actions workflows

How have the changes been tested?

If the .npmrc is completely missing from the repo, it will be created by the changeset "Canary version" action. This commits that file back to the repo with our secret exposed. This is a problem! I have just tested another canary release with a blank .npmrc which seems to prevent the exposed secret issue, however it does not seem to work for the actual publish.

This change should make sure that

  1. the npmrc is already in the repo so it should not need to be created during the changeset action
  2. the token is not written at all during CI, it is instead read from a secret env var. This should prove a bit safer in the long run in case something like this happens again.

Additional information

I followed this comment and their repo for this fix: changesets/action#98 (comment)

Don't forget to add a changeset if needed!

@CobyPear CobyPear added ci/cd bugfix Fixes a bug or typo labels Apr 5, 2023
@CobyPear CobyPear requested a review from backlineint April 5, 2023 15:48
@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2023

⚠️ No Changeset found

Latest commit: dfca75c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CobyPear CobyPear enabled auto-merge April 5, 2023 16:07
@CobyPear CobyPear merged commit 18ec4fb into pantheon-systems:canary Apr 5, 2023
@CobyPear CobyPear deleted the fix-release branch April 5, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a bug or typo ci/cd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E404 Not Found - PUT for published packages
2 participants