Repository navigation
Publish the version in package.json with the organization's npm token - #13
Draft
jwrosewell wants to merge 2 commits into
Draft
jwrosewell wants to merge 2 commits into
jwrosewell wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Makes the Publish package workflow able to publish the version in
package.json, so that@51degrees/ua-parser-js2.0.4 can reach npm. npm still serves 2.0.3 of 17 February 2023, with the README of that time, whilemainandrcare at 2.0.4 with the README from #5.Four changes to
.github/workflows/main.yml, and nothing else.NPM_TOKEN, last set on 17 February 2023. npm says "As of November 2025, only Granular access tokens are supported" and "Legacy access tokens have been removed" (About access tokens). It now uses the organization secretNPM_AUTH_TOKEN, which the other 51Degrees npm packages publish with, most recentlyfiftyone.devicedetection4.5.102 on 4 November 2026.versioninput, whose default was2.0.0, ranyarn versionand pushed a commit and a tag. The workflow now publishes the versionpackage.jsonholds, so only a reviewed commit can change it.yarn publish --non-interactivekeeps that version rather than asking for one.v<version>is now pushed after npm accepts the version, rather than before, so a failed publish leaves no tag behind.run-test.ymldoes, whose last run onrcpassed 94 of 94 tests with yarn 1.22.22.actions/checkoutandactions/setup-nodemove from v2 to v4.Before running it
rc, thenrcintomain(the lastrcintomainwas Release candidate #7 on 4 November).NPM_AUTH_TOKENis available to this repository. Reading which repositories an organization secret reaches needs an organization admin, so this was not checked.main. It publishes 2.0.4 and tagsv2.0.4. No tagv2.0.4exists today.How it was checked
versioncommand keeps the current version when it runs non-interactively, read from src/cli/commands/version.js on the master branch.run-test.ymlruns on every push.Outstanding
npm says "The ability to publish new package versions directly with a granular access token will be removed in January 2027", and recommends trusted publishing for CI (About access tokens). This workflow, like every 51Degrees npm publish, uses a token, so it needs moving to trusted publishing before then.