about summary refs log tree commit diff
path: root/src/tools/clippy/.github/workflows
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-04-22 11:31:13 +0200
committerflip1995 <philipp.krones@embecosm.com>2021-04-22 11:31:13 +0200
commit9482caf29fbe6b38f96689043b11329b80ca24bd (patch)
treeec9e87a7b7890f60e6a13357bffc6aaedbe08035 /src/tools/clippy/.github/workflows
parent71965ab4d05b023cd29c914ef1262a72cac02e01 (diff)
parent98e2b9f25b6db4b2680a3d388456d9f95cb28344 (diff)
downloadrust-9482caf29fbe6b38f96689043b11329b80ca24bd.tar.gz
rust-9482caf29fbe6b38f96689043b11329b80ca24bd.zip
Merge commit '98e2b9f25b6db4b2680a3d388456d9f95cb28344' into clippyup
Diffstat (limited to 'src/tools/clippy/.github/workflows')
-rw-r--r--src/tools/clippy/.github/workflows/clippy_bors.yml13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/tools/clippy/.github/workflows/clippy_bors.yml b/src/tools/clippy/.github/workflows/clippy_bors.yml
index 47253eecc4c..ae6f1aa1b30 100644
--- a/src/tools/clippy/.github/workflows/clippy_bors.yml
+++ b/src/tools/clippy/.github/workflows/clippy_bors.yml
@@ -34,15 +34,16 @@ jobs:
       run: |
         MESSAGE=$(git log --format=%B -n 1)
         PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
-        output=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
-          python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
-          grep "^changelog: " | \
-          sed "s/changelog: //g")
-        if [[ -z "$output" ]]; then
+        body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
+          python -c "import sys, json; print(json.load(sys.stdin)['body'])")
+        output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
           echo "ERROR: PR body must contain 'changelog: ...'"
           exit 1
-        elif [[ "$output" = "none" ]]; then
+        }
+        if [[ "$output" = "none" ]]; then
           echo "WARNING: changelog is 'none'"
+        else
+          echo "changelog: $output"
         fi
       env:
         PYTHONIOENCODING: 'utf-8'