File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
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
You can’t perform that action at this time.
0 commit comments