Skip to content

Commit 89c4902

Browse files
committed
Add force-publish option to reusable provenance workflow
1 parent 9bf49be commit 89c4902

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/provenance.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
required: false
1717
type: string
1818
default: '0'
19+
force-publish:
20+
description: 'Force publish without commit checks'
21+
required: false
22+
type: boolean
23+
default: false
1924
node-version:
2025
description: 'Node version to use (e.g., "20", "22", "24")'
2126
required: false
@@ -122,13 +127,23 @@ jobs:
122127

123128
- name: Publish with custom script (token-based)
124129
if: inputs.publish-script != '' && inputs.use-trusted-publishing == false
125-
run: pnpm run ${{ inputs.publish-script }}
130+
run: |
131+
if [ "${{ inputs.force-publish }}" = "true" ]; then
132+
pnpm run ${{ inputs.publish-script }} -- --force-publish
133+
else
134+
pnpm run ${{ inputs.publish-script }}
135+
fi
126136
env:
127137
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
128138

129139
- name: Publish with custom script (trusted publishing)
130140
if: inputs.publish-script != '' && inputs.use-trusted-publishing == true
131-
run: pnpm run ${{ inputs.publish-script }}
141+
run: |
142+
if [ "${{ inputs.force-publish }}" = "true" ]; then
143+
pnpm run ${{ inputs.publish-script }} -- --force-publish
144+
else
145+
pnpm run ${{ inputs.publish-script }}
146+
fi
132147
133148
- name: Publish package (token-based)
134149
if: inputs.publish-script == '' && inputs.package-name != '' && inputs.use-trusted-publishing == false

0 commit comments

Comments
 (0)