File tree 1 file changed +7
-6
lines changed 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,16 @@ jobs:
34
34
run : |
35
35
MESSAGE=$(git log --format=%B -n 1)
36
36
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") || {
42
40
echo "ERROR: PR body must contain 'changelog: ...'"
43
41
exit 1
44
- elif [[ "$output" = "none" ]]; then
42
+ }
43
+ if [[ "$output" = "none" ]]; then
45
44
echo "WARNING: changelog is 'none'"
45
+ else
46
+ echo "changelog: $output"
46
47
fi
47
48
env :
48
49
PYTHONIOENCODING : ' utf-8'
You can’t perform that action at this time.
0 commit comments