Skip to content

Commit bd2b2c3

Browse files
committed
fix(promote): rename release-publish-enable and fix required file input
Rename release-publish-enable to update-release-enabled to align with the update-release-* input prefix. Add a prepare-release-file step that creates an empty placeholder when no update-release-file is supplied, satisfying svenstaro/upload-release-action's required file input.
1 parent 72aa0ae commit bd2b2c3

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/promote.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ on:
153153
required: false
154154
type: boolean
155155
default: true
156-
release-publish-enable:
156+
update-release-enabled:
157157
description: 'Create or update a GitHub release after the git push. Requires changelog-enabled to be true.'
158158
required: false
159159
type: boolean
@@ -210,10 +210,10 @@ jobs:
210210
changelog: ${{ steps.release_changelog.outputs.content }}
211211
steps:
212212
- name: validate inputs
213-
if: inputs.release-publish-enable && !inputs.changelog-enabled
213+
if: inputs.update-release-enabled && !inputs.changelog-enabled
214214
shell: bash
215215
run: |
216-
echo "::error::release-publish-enable requires changelog-enabled to be true"
216+
echo "::error::update-release-file requires changelog-enabled to be true"
217217
exit 1
218218
219219
- name: checkout repository
@@ -315,13 +315,26 @@ jobs:
315315
git-user-email: ${{ inputs.git-user-email }}
316316
git-add-files: ${{ steps.resolve_changelog_git_add_files.outputs.files || inputs.git-add-files }}
317317

318+
- name: prepare release file
319+
if: inputs.update-release-enabled && inputs.push-git
320+
id: prepare_release_file
321+
shell: bash
322+
run: |
323+
set -euo pipefail
324+
FILE="${{ inputs.update-release-file }}"
325+
if [ -z "$FILE" ]; then
326+
touch /tmp/.release-placeholder
327+
FILE="/tmp/.release-placeholder"
328+
fi
329+
echo "file=$FILE" >> "$GITHUB_OUTPUT"
330+
318331
- name: publish github release
319-
if: inputs.release-publish-enable && inputs.push-git
332+
if: inputs.update-release-enabled && inputs.push-git
320333
uses: svenstaro/upload-release-action@v2
321334
with:
322335
repo_token: ${{ inputs.update-release-token || github.token }}
323336
tag: ${{ inputs.update-release-tag || format('{0}{1}', inputs.version-tag-prefix, steps.release_version.outputs.version) }}
324-
file: ${{ inputs.update-release-file }}
337+
file: ${{ steps.prepare_release_file.outputs.file }}
325338
file_glob: true
326339
body: ${{ steps.release_changelog.outputs.content }}
327340
overwrite: ${{ inputs.update-release-overwrite }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
git-user-email: 203600057+getdevopspro-cibot@users.noreply.github.com
3131
make-target-pre-push: release-version
3232
changelog-enabled: true
33-
release-publish-enable: true
33+
update-release-file: true

0 commit comments

Comments
 (0)