From f6615d44e925679893e725c7651f9e1979253822 Mon Sep 17 00:00:00 2001 From: Oto Macenauer Date: Wed, 1 Jul 2026 02:09:04 +0200 Subject: [PATCH] ci: add PR requirements check (AbsaOSS/check-pr-requirements) Validate PR hygiene on every pull request to master: conventional title, description (min length), issue reference, branch name, size, and target branch. The action is SHA-pinned to v0.2.0 (Dependabot manages bumps). Uses branch-pattern (v0.2.0 has no branch-prefixes input); the pattern allows this repo's prefixes plus dependabot's multi-segment branch names. Closes #8 Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/pr-requirements.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/pr-requirements.yml diff --git a/.github/workflows/pr-requirements.yml b/.github/workflows/pr-requirements.yml new file mode 100644 index 0000000..0d1034f --- /dev/null +++ b/.github/workflows/pr-requirements.yml @@ -0,0 +1,51 @@ +# Validates pull-request hygiene: conventional title, description, issue +# reference, branch name, size, and target branch. +# Action: AbsaOSS/check-pr-requirements (SHA-pinned; see Dependabot for bumps). + +name: PR Requirements + +on: + pull_request: + types: [opened, synchronize, reopened, edited, labeled, unlabeled] + branches: [master] + +# Least privilege: read PR metadata only. +permissions: + contents: read + pull-requests: read + +jobs: + check-pr: + name: PR Requirements + runs-on: ubuntu-latest + steps: + - name: Check PR requirements + uses: AbsaOSS/check-pr-requirements@adb22f6d88c93fd801e787a63d948d6fbbdd4af3 # v0.2.0 + with: + pr-title: ${{ github.event.pull_request.title }} + pr-body: ${{ github.event.pull_request.body }} + pr-branch: ${{ github.event.pull_request.head.ref }} + pr-number: ${{ github.event.pull_request.number }} + target-branch: ${{ github.event.pull_request.base.ref }} + files-changed: ${{ github.event.pull_request.changed_files }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + # Enabled checks + check-title: "true" + check-description: "true" + check-issue-reference: "true" + check-branch-name: "true" + check-pr-size: "true" + check-target-branch: "true" + check-release-notes: "false" # no release-notes convention yet + check-label: "false" + + # Configuration + title-formats: "conventional" + title-types: "feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert" + description-min-length: "20" + # Branch names this repo uses; the char class allows the extra path + # segments in dependabot branches (e.g. dependabot/npm_and_yarn/…). + branch-pattern: "^(feature|bugfix|hotfix|release|support|chore|docs|ci|test|dependabot)/[a-zA-Z0-9._/-]+$" + max-files-changed: "50" + allowed-target-branches: "master"