Skip to content

Commit 8962ba8

Browse files
committed
fix(npm): add --allow-same-version and configurable scope
- Add --allow-same-version to npm version from-git to handle repos that keep package.json in sync with git tags - Add npm_scope input (default: @Zondax) so non-zondax packages can configure their scope for registry auth
1 parent 05489fc commit 8962ba8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/_publish-npm.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ on:
3030
required: false
3131
type: string
3232
default: "22"
33+
npm_scope:
34+
description: "npm scope for registry auth (e.g. @zondax, @kunobi)"
35+
required: false
36+
type: string
37+
default: "@zondax"
3338

3439
secrets:
3540
app_id:
@@ -98,7 +103,7 @@ jobs:
98103
with:
99104
node-version: ${{ inputs.node_version }}
100105
registry-url: "https://registry.npmjs.org"
101-
scope: "@zondax"
106+
scope: ${{ inputs.npm_scope }}
102107

103108
- name: Upgrade npm for OIDC support
104109
run: |
@@ -112,7 +117,7 @@ jobs:
112117
- name: Set version from Git
113118
run: |
114119
if git describe --tags --abbrev=0 --match='*.*.*' 2>/dev/null; then
115-
npm version from-git --no-git-tag-version
120+
npm version from-git --no-git-tag-version --allow-same-version
116121
elif [ "$DRY_RUN" = "true" ]; then
117122
echo "No semver tags found, keeping version from package.json (dry-run)"
118123
else

0 commit comments

Comments
 (0)