4646 required : false
4747 default : " "
4848 type : string
49+ skip-publish :
50+ description : " Create and prepare release but skip publish/tag/branch updates"
51+ required : false
52+ default : false
53+ type : boolean
4954 publish-no-latest-on-non-main :
5055 description : " Pass --no-latest on non-main branch releases"
5156 required : false
@@ -165,14 +170,15 @@ jobs:
165170 run : ${{ inputs.post-create }}
166171
167172 - name : Run pre-publish script
168- if : inputs.pre-publish != ''
173+ if : ${{ inputs.pre-publish != '' && !inputs['skip-publish'] }}
169174 run : ${{ inputs.pre-publish }}
170175 env :
171176 CHANGELOG_ROOT : ${{ inputs.changelog-root }}
172177 RELEASE_VERSION : ${{ steps.create-release.outputs.version }}
173178 GH_TOKEN : ${{ steps.app-token.outputs.token }}
174179
175180 - name : Stage and publish
181+ if : ${{ !inputs['skip-publish'] }}
176182 run : |
177183 git add "$CHANGELOG_ROOT/changelog"
178184 if [ -n "$GIT_ADD_PATHS" ]; then
@@ -192,7 +198,7 @@ jobs:
192198 GH_TOKEN : ${{ steps.app-token.outputs.token }}
193199
194200 - name : Copy release to main branch (non-main release)
195- if : inputs.copy-release-to-main-on-non-main && steps.release-type.outputs.is_latest == 'false'
201+ if : ${{ ! inputs['skip-publish'] && inputs .copy-release-to-main-on-non-main && steps.release-type.outputs.is_latest == 'false' }}
196202 run : |
197203 RELEASE_DIR="$CHANGELOG_ROOT/changelog/releases/$RELEASE_VERSION"
198204 TMP_DIR="$(mktemp -d)"
@@ -213,13 +219,13 @@ jobs:
213219 RELEASE_VERSION : ${{ steps.create-release.outputs.version }}
214220
215221 - name : Update latest branch
216- if : inputs.update-latest-branch-on-main && steps.release-type.outputs.is_latest == 'true'
222+ if : ${{ ! inputs['skip-publish'] && inputs .update-latest-branch-on-main && steps.release-type.outputs.is_latest == 'true' }}
217223 run : |
218224 git checkout -B latest
219225 git push origin latest --force
220226
221227 - name : Run post-publish script
222- if : inputs.post-publish != ''
228+ if : ${{ inputs.post-publish != '' && !inputs['skip-publish'] }}
223229 run : ${{ inputs.post-publish }}
224230 env :
225231 CHANGELOG_ROOT : ${{ inputs.changelog-root }}
@@ -238,4 +244,5 @@ jobs:
238244 echo ""
239245 echo "- Branch: \`${GITHUB_REF_NAME}\`"
240246 echo "- Latest release: \`${IS_LATEST}\`"
247+ echo "- Publish skipped: \`${{ inputs['skip-publish'] }}\`"
241248 } >> "$GITHUB_STEP_SUMMARY"
0 commit comments