Skip to content

Commit 7734ac5

Browse files
authored
Merge branch 'awslabs:main' into main
2 parents 4c5a05f + 273bff6 commit 7734ac5

3 files changed

Lines changed: 310 additions & 7 deletions

File tree

.github/workflows/release-pr.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
VERSION="${MAJOR}.${MINOR}.${PATCH}"
7171
echo "WARNING: No conventional commits detected — falling back to patch bump: $VERSION"
7272
else
73-
echo "::warning::No conventional commits and no existing tags — nothing to release"
73+
echo "::error::No conventional commits and no existing tags — nothing to release"
7474
exit 1
7575
fi
7676
fi
@@ -109,7 +109,7 @@ jobs:
109109
110110
# Check if branch already exists (local or remote)
111111
if git ls-remote --exit-code --heads origin "$BRANCH" &>/dev/null; then
112-
echo "::warning::Branch '$BRANCH' already exists. A release PR may already be open — close it and delete the branch to re-run."
112+
echo "::error::Branch '$BRANCH' already exists. A release PR may already be open — close it and delete the branch to re-run."
113113
exit 1
114114
fi
115115
@@ -118,24 +118,24 @@ jobs:
118118
119119
git add CHANGELOG.md
120120
if git diff --cached --quiet CHANGELOG.md; then
121-
echo "No changes to CHANGELOG.md"
121+
echo "::error::No releasable commits since last tag – CHANGELOG.md is already up to date. Push new conventional commits or adjust the requested version before rerunning this workflow."
122122
exit 1
123123
fi
124124
125125
git checkout -b "$BRANCH"
126126
git commit -m "docs: update changelog for $TAG"
127127
git push origin "$BRANCH"
128128
129-
LABEL_FLAG=""
129+
label_args=()
130130
for LABEL in "release"; do
131131
if gh label list --search "$LABEL" --json name --jq '.[].name' | grep -qx "$LABEL"; then
132-
LABEL_FLAG="$LABEL_FLAG --label $LABEL"
132+
label_args+=("--label" "$LABEL")
133133
fi
134134
done
135135
136136
# Draft PR because the github-actions[bot] does not trigger a pull_request_target workflow
137137
gh pr create \
138-
--title "docs: update changelog for $BRANCH" \
138+
--title "docs: update changelog for $TAG" \
139139
--draft \
140140
--body "$(cat <<EOF
141141
# Release $TAG
@@ -169,4 +169,4 @@ jobs:
169169
After both workflows complete, review and publish the draft release.
170170
EOF
171171
)" \
172-
$LABEL_FLAG
172+
"${label_args[@]}"

0 commit comments

Comments
 (0)