JS-DevTools/npm-publish

Publish function always reports publishing to NPM even when alternative registry is used

rorysedgwick opened this issue · 0 comments

The package supports multiple registry URLs to publish to, however it always reports success/failure of publishing to NPM regardless of which registry was configured as the target.

Ideally it would parse the registry URL and determine which was being used, and report that.

For use cases where there may be multiple registries being published to, it becomes particularly useful to be able to avoid confusion about which was being use in a certain CI step, for example.

I imagine updating this string, and the equivalent in the CLI, to use an interpolation rather than the hardcoded NPM would do the trick.


Sample output from a Github Workflow running this action and publishing to the Github Package Registry:

Run JS-DevTools/npm-publish@v1
  with:
    token: ***
    registry: https://npm.pkg.github.com/
    package: package.json
    tag: latest
    dry-run: false
    check-version: true

> @<scope>/github-package-publish-test@0.0.3 prepublishOnly .
> npm test && npm run lint


> @<scope>/github-package-publish-test@0.0.3 test /home/runner/work/github-package-publish-test/github-package-publish-test
> jest --config jestconfig.json

PASS src/__tests__/index.test.ts
  ✓ init (2 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.133 s, estimated 3 s
Ran all test suites.

> @<scope>/github-package-publish-test@0.0.3 lint /home/runner/work/github-package-publish-test/github-package-publish-test
> tslint -p tsconfig.json

npm notice 
npm notice 📦  @<scope>/github-package-publish-test@0.0.3
npm notice === Tarball Contents === 
npm notice 189B  dist/index.js  
npm notice 1.5kB package.json   
npm notice 1.1kB README.md      
npm notice 42B   dist/index.d.ts
npm notice === Tarball Details === 
npm notice name:          @<scope>/github-package-publish-test 
npm notice version:       0.0.3                                   
npm notice package size:  1.3 kB                                  
npm notice unpacked size: 2.9 kB                                  
npm notice shasum:        d509a842e5f47f0ba3b154328a286e402ba983b3
npm notice integrity:     sha512-wrpD7XDhT+nKT[...]Vn5MxPGw8DxQA==
npm notice total files:   4                                       
npm notice 
+ @<scope>/github-package-publish-test@0.0.3

📦 Successfully published @<scope>/github-package-publish-test v0.0.3 to NPM