Skip to content

Commit b684ab8

Browse files
committed
feat(workflows): add force-registry and skip-npm-packages flags
Add workflow inputs to control publishing behavior: - force-registry: Force publish @socketsecurity/registry regardless of version - skip-npm-packages: Skip publishing npm override packages (packages/*) Update flag handling to properly combine multiple flags.
1 parent 398fb77 commit b684ab8

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

.github/workflows/_local-not-for-reuse-provenance.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ on:
1919
required: false
2020
default: false
2121
type: boolean
22+
force-registry:
23+
description: 'Force publish @socketsecurity/registry regardless of version changes'
24+
required: false
25+
default: false
26+
type: boolean
27+
skip-npm-packages:
28+
description: 'Skip publishing npm override packages (packages/*)'
29+
required: false
30+
default: false
31+
type: boolean
2232

2333
permissions:
2434
contents: write
@@ -30,6 +40,8 @@ jobs:
3040
with:
3141
debug: ${{ inputs.debug }}
3242
force-publish: ${{ inputs.force-publish }}
33-
publish-script: 'package-npm-publish'
43+
force-registry: ${{ inputs.force-registry }}
44+
skip-npm-packages: ${{ inputs.skip-npm-packages }}
45+
publish-script: 'package-npm-publish' # runs scripts/publish-npm-packages.mjs
3446
setup-script: 'pnpm run build'
3547
use-trusted-publishing: true

.github/workflows/provenance.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ on:
2121
required: false
2222
type: boolean
2323
default: false
24+
force-registry:
25+
description: 'Force publish @socketsecurity/registry regardless of version changes'
26+
required: false
27+
type: boolean
28+
default: false
29+
skip-npm-packages:
30+
description: 'Skip publishing npm override packages (packages/*)'
31+
required: false
32+
type: boolean
33+
default: false
2434
node-version:
2535
description: 'Node version to use (e.g., "20", "22", "24")'
2636
required: false
@@ -128,8 +138,18 @@ jobs:
128138
- name: Publish with custom script (token-based)
129139
if: inputs.publish-script != '' && inputs.use-trusted-publishing == false
130140
run: |
141+
FLAGS=""
131142
if [ "${{ inputs.force-publish }}" = "true" ]; then
132-
pnpm run ${{ inputs.publish-script }} -- --force-publish
143+
FLAGS="$FLAGS --force-publish"
144+
fi
145+
if [ "${{ inputs.force-registry }}" = "true" ]; then
146+
FLAGS="$FLAGS --force-registry"
147+
fi
148+
if [ "${{ inputs.skip-npm-packages }}" = "true" ]; then
149+
FLAGS="$FLAGS --skip-npm-packages"
150+
fi
151+
if [ -n "$FLAGS" ]; then
152+
pnpm run ${{ inputs.publish-script }} -- $FLAGS
133153
else
134154
pnpm run ${{ inputs.publish-script }}
135155
fi
@@ -139,8 +159,18 @@ jobs:
139159
- name: Publish with custom script (trusted publishing)
140160
if: inputs.publish-script != '' && inputs.use-trusted-publishing == true
141161
run: |
162+
FLAGS=""
142163
if [ "${{ inputs.force-publish }}" = "true" ]; then
143-
pnpm run ${{ inputs.publish-script }} -- --force-publish
164+
FLAGS="$FLAGS --force-publish"
165+
fi
166+
if [ "${{ inputs.force-registry }}" = "true" ]; then
167+
FLAGS="$FLAGS --force-registry"
168+
fi
169+
if [ "${{ inputs.skip-npm-packages }}" = "true" ]; then
170+
FLAGS="$FLAGS --skip-npm-packages"
171+
fi
172+
if [ -n "$FLAGS" ]; then
173+
pnpm run ${{ inputs.publish-script }} -- $FLAGS
144174
else
145175
pnpm run ${{ inputs.publish-script }}
146176
fi

0 commit comments

Comments
 (0)