Skip to content

Commit b1c675f

Browse files
committed
Auto merge of rust-lang#7070 - camsteffen:changelog-stderr, r=flip1995
Fix changelog check output Error messages are more helpful if you can see them. changelog: none
2 parents 24921df + 0d14429 commit b1c675f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/clippy_bors.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ jobs:
3434
run: |
3535
MESSAGE=$(git log --format=%B -n 1)
3636
PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
37-
output=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
38-
python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
39-
grep "^changelog: " | \
40-
sed "s/changelog: //g")
41-
if [[ -z "$output" ]]; then
37+
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
38+
python -c "import sys, json; print(json.load(sys.stdin)['body'])")
39+
output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
4240
echo "ERROR: PR body must contain 'changelog: ...'"
4341
exit 1
44-
elif [[ "$output" = "none" ]]; then
42+
}
43+
if [[ "$output" = "none" ]]; then
4544
echo "WARNING: changelog is 'none'"
45+
else
46+
echo "changelog: $output"
4647
fi
4748
env:
4849
PYTHONIOENCODING: 'utf-8'

0 commit comments

Comments
 (0)