File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff 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'
You can’t perform that action at this time.
0 commit comments