From 8f6d1ca2f1dd4252d005e96cd669d528ec1bab14 Mon Sep 17 00:00:00 2001 From: Jamil Date: Tue, 7 Jan 2025 10:39:12 -0800 Subject: [PATCH] ci: Enforce PR titles to be <= 72 characters (#7688) --- .github/workflows/_static-analysis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/_static-analysis.yml b/.github/workflows/_static-analysis.yml index f14c157b1..9d4a2e2ab 100644 --- a/.github/workflows/_static-analysis.yml +++ b/.github/workflows/_static-analysis.yml @@ -9,6 +9,14 @@ jobs: permissions: pull-requests: read steps: + - name: Enforce PR title length <= 72 + # Don't run for Dependabot PRs + if: ${{ !contains(github.event.pull_request.head.label, 'dependabot') }} + run: | + if [ $(echo "${{ github.event.pull_request.title }}" | wc -c) -gt 72 ]; then + echo "PR title too long. Please keep it under 72 characters." + exit 1 + fi - uses: amannn/action-semantic-pull-request@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}