@@ -20,14 +20,17 @@ jobs:
20
20
env :
21
21
GH_TOKEN : ${{ github.token }}
22
22
run : |
23
- echo "::group::Output PR # and labels"
24
23
LAST_PR_NUMBER=$(gh pr list --state merged --json number --jq '.[0].number')
25
24
LABELS=$(gh pr view "$LAST_PR_NUMBER" --json labels --jq '.labels[].name')
26
25
echo "::notice::PR used to check version bump: #$LAST_PR_NUMBER"
27
26
echo "::notice::PR labels: "[${LABELS//$'\n'/,}]""
28
- echo "::endgroup::"
29
27
30
- RELEASE_TYPE=$(./.github/ci-scripts/pr-label-check.sh)
28
+ RELEASE_TYPE=$(./.github/ci-scripts/pr-label-check.sh) || exit_code=$?
29
+ if [ "$exit_code" -ne 0 ]; then
30
+ echo "::error::PR #"$LAST_PR_NUMBER" has more than one release label"
31
+ exit $exit_code
32
+ fi
33
+
31
34
echo "version=$RELEASE_TYPE" >> $GITHUB_OUTPUT
32
35
echo "::group::Output version"
33
36
echo "::notice::Release type: $RELEASE_TYPE"
54
57
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55
58
run : |
56
59
VERSION=$(node -p "require('./package.json').version")
57
- gh release create "v${VERSION}" \
58
- --title "Release v${VERSION}" \
59
- --generate-notes \
60
- --prerelease \
61
- --target "${COMMIT_SHA}"
60
+ echo "Would execute command:"
61
+ echo "gh release create \"v${VERSION}\" \\"
62
+ echo " --title \"Release v${VERSION}\" \\"
63
+ echo " --generate-notes \\"
64
+ echo " --prerelease \\"
65
+ echo " --target \"${COMMIT_SHA}\""
0 commit comments