Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_call:
inputs:
build_ref:
description: 'Git ref to build (commit SHA, branch, or tag)'
description: 'What to build; release_tag is created at it (full commit SHA or branch name)'
type: string
required: true
release_tag:
Expand Down Expand Up @@ -728,11 +728,14 @@ jobs:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG: ${{ inputs.release_tag }}
BUILD_REF: ${{ inputs.build_ref }}
PRERELEASE: ${{ inputs.is_prerelease }}
run: |
set -euo pipefail
if ! gh release view "$TAG" >/dev/null 2>&1; then
flags=(--title "$TAG" --generate-notes)
# without --target the tag is created at main's HEAD of this moment, which is never the
# PR head a preview was built from and is not the main commit either once something lands during the build
flags=(--title "$TAG" --target "$BUILD_REF" --generate-notes)
[ "$PRERELEASE" = "true" ] && flags+=(--prerelease)
gh release create "$TAG" "${flags[@]}"
fi
Expand Down
Loading