about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2020-01-21 21:40:40 +0100
committerflip1995 <hello@philkrones.com>2020-02-12 09:34:26 +0100
commitff8336b0a04237f3c151dd59cd915ad8eedfa093 (patch)
tree469df1cbbe981d0ef0bd18c842e5c7bb0a240242
parent1717a6f7d5784275337600bc534e35243471c1c5 (diff)
downloadrust-ff8336b0a04237f3c151dd59cd915ad8eedfa093.tar.gz
rust-ff8336b0a04237f3c151dd59cd915ad8eedfa093.zip
Check if changelog exists
-rw-r--r--.github/workflows/clippy_bors.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/.github/workflows/clippy_bors.yml b/.github/workflows/clippy_bors.yml
index 6a6d58410f9..2267b46f9fc 100644
--- a/.github/workflows/clippy_bors.yml
+++ b/.github/workflows/clippy_bors.yml
@@ -16,7 +16,30 @@ env:
   GHA_CI: 1
 
 jobs:
+  changelog:
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2.0.0
+      with:
+        ref: ${{ github.ref }}
+    - name: Check Changelog
+      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
+          echo "ERROR: PR body must contain 'changelog: ...'"
+          exit 1
+        elif [[ "$output" = "none" ]]; then
+          echo "WARNING: changelog is 'none'"
+        fi
   base:
+    needs: changelog
     strategy:
       matrix:
         os: [ubuntu-latest, windows-latest, macos-latest]