about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlapla-cogito <me@lapla.dev>2025-01-24 09:02:00 +0900
committerlapla-cogito <me@lapla.dev>2025-01-24 11:47:21 +0900
commita8551362f2d9a80dbd7227947d7f68c04e3485f1 (patch)
tree68233697d9cb0e7994e9dafb79f8297f9bbc9702
parent396de5748b5b1e37cb57814818f4bc878851f030 (diff)
downloadrust-a8551362f2d9a80dbd7227947d7f68c04e3485f1.tar.gz
rust-a8551362f2d9a80dbd7227947d7f68c04e3485f1.zip
set default changelog messages to fail the changelog CI
-rw-r--r--.github/workflows/clippy_changelog.yml10
1 files changed, 6 insertions, 4 deletions
diff --git a/.github/workflows/clippy_changelog.yml b/.github/workflows/clippy_changelog.yml
index 6df5a48c75f..a2657bfea49 100644
--- a/.github/workflows/clippy_changelog.yml
+++ b/.github/workflows/clippy_changelog.yml
@@ -26,11 +26,13 @@ jobs:
       run: |
         body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR_NUMBER" | \
           python -c "import sys, json; print(json.load(sys.stdin)['body'])")
-        output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
-          echo "ERROR: pull request message must contain 'changelog: ...'. Please add it."
+        output=$(awk '/^changelog:\s*\S/ && !/changelog: \[.*\]: your change/' <<< "$body" | sed "s/changelog:\s*//g")
+        if [ -z "$output" ]; then
+          echo "ERROR: pull request message must contain 'changelog: ...' with your changelog. Please add it."
           exit 1
-        }
-        echo "changelog: $output"
+        else
+          echo "changelog: $output"
+        fi
       env:
         PYTHONIOENCODING: 'utf-8'
         PR_NUMBER: '${{ github.event.number }}'