add howto obtain curl package endpoint from npm

This commit is contained in:
justknow 2025-04-03 14:18:44 +00:00
parent fef7df3de6
commit be388362dc

View file

@ -176,3 +176,9 @@ jobs:
- name: Publish to registry - name: Publish to registry
run: npm publish --scope=@{scope} --registry=${{github.SERVER_URL}}/api/packages/{owner}/npm/ run: npm publish --scope=@{scope} --registry=${{github.SERVER_URL}}/api/packages/{owner}/npm/
``` ```
When using Forgejo Actions with the NPM registry, you may have to use npm to obtain certain information. For instance, due to the structure of Forgejo's package storage, the published tarball is not stored in the `SERVER_URL/USER/-/packages/npm/PACKAGE_NAME/PACKAGE_VERSION/files/PACKAGE_ID/` location in the UI where it can be manually obtained. If you need to access the tarball directly, use this command to get a URL compatible with curl and other CLI tools that can run in Forgejo Actions.
```
npm view PACKAGE_NAME{@PACKAGE_VERSION} --registry={REGISTRY_URL} dist.tarball
```