From 583bb9440fe25be19dd1c030bcc8c6b4bc31c731 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Mon, 15 Jun 2026 19:55:59 +0200 Subject: [PATCH] ci: enforce Conventional Commit PR titles Add a PR Title workflow using amannn/action-semantic-pull-request to validate that pull request titles follow Conventional Commits. Squash merging uses the PR title as the commit subject (squash_merge_commit_title = PR_TITLE), so this is what keeps the commits landing on main parseable by release-please. The job runs on pull_request for validation and on merge_group as a no-op pass-through, so it can be wired in as a required merge-queue status check without stalling the queue. Change-Id: I6b2b4f8478c1bb79a9beaa3613b7bc8b0765c668 Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Thomas Kosiewski --- .github/workflows/pr-title.yml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/pr-title.yml diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..53da73c --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,39 @@ +name: PR Title + +# Enforce Conventional Commits in pull request titles. Squash merging is +# configured to use the PR title as the commit subject (squash_merge_commit_title +# = PR_TITLE), so the PR title becomes the commit that lands on main. A compliant +# title is therefore what lets release-please parse the change and pick the right +# version bump / changelog entry. +# +# The job also runs on merge_group as a no-op pass-through: the title is already +# validated on the PR before it can enter the queue, and the merge_group event +# carries no pull request payload to re-check. Running here keeps the `pr-title` +# status check present on the merge group so it can be a required merge-queue check. +on: + pull_request: + types: [opened, edited, synchronize, reopened] + merge_group: + +concurrency: + group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: read + +jobs: + pr-title: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Validate PR title is a Conventional Commit + if: github.event_name == 'pull_request' + uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Skip in merge queue (title already validated on the PR) + if: github.event_name == 'merge_group' + run: echo "PR title was validated on the pull request before it entered the queue; nothing to check here."