Skip to content

Commit fa57a5b

Browse files
committed
Fix issuex with the breaking change drafter
1 parent 869f9f8 commit fa57a5b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ jobs:
6060
if [ -n "$username" ]; then
6161
echo "@$username"
6262
else
63-
username=$(gh api "/search/users?q=$email+in:email" --jq '.items[0].login' 2>/dev/null || true)
64-
if [ -n "$username" ] && [ "$username" != "null" ]; then
63+
username=$(gh api "/search/users?q=$email+in:email" --jq '.items[0].login // empty' 2>&1 || echo "")
64+
# If gh api failed, username will contain error JSON — reject anything that's not a simple word
65+
if [[ "$username" =~ ^[a-zA-Z0-9_-]+$ ]]; then
6566
echo "@$username"
6667
else
6768
echo "@$name"
@@ -94,9 +95,9 @@ jobs:
9495
9596
if [ $exit_code -eq 1 ] && [ -n "$breaking_output" ]; then
9697
echo "found=true" >> $GITHUB_OUTPUT
97-
echo "content<<EOF" >> $GITHUB_OUTPUT
98-
echo "$breaking_output" >> $GITHUB_OUTPUT
99-
echo "EOF" >> $GITHUB_OUTPUT
98+
echo "BREAKING_CONTENT<<EOF" >> $GITHUB_ENV
99+
echo "$breaking_output" >> $GITHUB_ENV
100+
echo "EOF" >> $GITHUB_ENV
100101
else
101102
echo "found=false" >> $GITHUB_OUTPUT
102103
fi
@@ -160,8 +161,7 @@ jobs:
160161
161162
# Prepend breaking changes
162163
if [ "${{ steps.breaking.outputs.found }}" = "true" ]; then
163-
breaking_section="${{ steps.breaking.outputs.content }}"
164-
BODY="${breaking_section}
164+
BODY="${BREAKING_CONTENT}
165165
166166
${BODY}"
167167
fi

0 commit comments

Comments
 (0)