From a36460c8e4e1de2fbe183bc9eb1184cb2f466937 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Thu, 12 Sep 2024 13:19:48 -0700 Subject: [PATCH] ci: Prebuild action fails if Changelog is missing from all commits of a PR Changelog-None. --- .github/workflows/ci.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9e4b78a7e13c..90e12817325b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,6 +42,16 @@ jobs: git fetch origin ${{ github.base_ref }} git rebase origin/${{ github.base_ref }} + - name: Check changelog + run: | + base_ref="${{ github.base_ref }}" + if [ -z "$base_ref" ]; then + base_ref="master" + fi + if [[ -z "$(git log origin/$base_ref..HEAD --oneline --grep='Changelog-')" && "$(git rev-parse --abbrev-ref HEAD)" != "$base_ref" ]]; then + echo "::error::'Changelog' entry is missing in all commits" && exit 1 + fi + - name: Set up Python 3.8 uses: actions/setup-python@v5 with: