From b10dd52ac5faedc64be15aaa8dc0b4656020e1dd Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 24 Oct 2024 17:01:47 +0200 Subject: [PATCH] Add github action for PR title validation --- .github/workflows/check-pr-title.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/check-pr-title.yml diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml new file mode 100644 index 000000000..6cb17f606 --- /dev/null +++ b/.github/workflows/check-pr-title.yml @@ -0,0 +1,22 @@ +name: "Check PR Title" +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled, converted_to_draft, edited] + +jobs: + check-pr-title: + name: Check PR Title + runs-on: ubuntu-latest + steps: + - name: Enforce conventional commit style + uses: realm/ci-actions/title-checker@main + with: + regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|ops){1}(\([\w\-\.]+\))?(!)?: .*' + error-hint: 'Invalid PR title. Make sure it follows the conventional commit specification (i.e. "(): ") or add the no-title-validation label' + ignore-labels: 'no-jira-ticket' + - name: Enforce JIRA ticket in title + uses: realm/ci-actions/title-checker@main + with: + regex: 'VSCODE-[0-9]{1,5}$' + error-hint: 'Invalid PR title. Make sure it ends with a JIRA ticket - i.e. VSCODE-1234 or add the no-title-validation label' + ignore-labels: 'no-title-validation'