From b74950a5ef174561cd379dccd831bd5a6ea91bed Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 5 Mar 2026 20:04:05 +0000 Subject: [PATCH 1/6] feat: Implement check-pr-title workflow --- .github/workflows/check-pr-title.yml | 22 ++++++++++++++++++++++ .github/workflows/test-check-pr-title.yml | 11 +++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/check-pr-title.yml create mode 100644 .github/workflows/test-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 0000000..ed70d80 --- /dev/null +++ b/.github/workflows/check-pr-title.yml @@ -0,0 +1,22 @@ +name: Check PR title + +on: + workflow_call: + +jobs: + check_title: + runs-on: ubuntu-latest + + steps: + - uses: ytanikin/pr-conventional-commits@fda730cb152c05a849d6d84325e50c6182d9d1e9 # 1.5.1 + with: + task_types: '["build", "feat", "fix", "docs", "test", "ci", "style", "refactor", "perf", "chore"]' + + - name: Check if title starts with upper-case letter + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + if [[ ! "${PR_TITLE}" =~ ^[a-z]+:\ [\[A-Z] ]]; then + echo "Error: PR title must start with an upper-case letter." + exit 1 + fi diff --git a/.github/workflows/test-check-pr-title.yml b/.github/workflows/test-check-pr-title.yml new file mode 100644 index 0000000..337fc7c --- /dev/null +++ b/.github/workflows/test-check-pr-title.yml @@ -0,0 +1,11 @@ +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + schedule: + - cron: "0 8 * * *" + +jobs: + test-check-pr-title: + uses: ./.github/workflows/check-pr-title.yml From 49d3f6b69e19bf6b29baa1a79446736c3db303f5 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 5 Mar 2026 20:06:48 +0000 Subject: [PATCH 2/6] Do not add label --- .github/workflows/check-pr-title.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index ed70d80..41dd06d 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -11,6 +11,7 @@ jobs: - uses: ytanikin/pr-conventional-commits@fda730cb152c05a849d6d84325e50c6182d9d1e9 # 1.5.1 with: task_types: '["build", "feat", "fix", "docs", "test", "ci", "style", "refactor", "perf", "chore"]' + add_label: false - name: Check if title starts with upper-case letter env: From 517a0c79783132182718ccea85c00b0f34ff97d9 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 5 Mar 2026 20:08:54 +0000 Subject: [PATCH 3/6] Provide explicit types --- .github/workflows/test-check-pr-title.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-check-pr-title.yml b/.github/workflows/test-check-pr-title.yml index 337fc7c..c85b1f7 100644 --- a/.github/workflows/test-check-pr-title.yml +++ b/.github/workflows/test-check-pr-title.yml @@ -1,5 +1,6 @@ on: pull_request: + types: [opened, edited, reopened, synchronize] push: branches: [main] workflow_dispatch: From e5dbfd2de270703f472549c8786d2a95a0ee982b Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 6 Mar 2026 12:37:22 +0000 Subject: [PATCH 4/6] Update docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9d1e068..fa9ba58 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Reusable workflows and actions for XRPLF repos ## Available Reusable Workflows +- `check-pr-title.yml`: Checks the title of Pull Requests against a specified pattern. - `pre-commit.yml`: Runs `pre-commit` checks on code changes. - `pre-commit-autoupdate.yml`: Runs `pre-commit autoupdate` to update pre-commit hooks. From c59fa73b31f4bfcc5542176d3b2f123352cee1da Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 6 Mar 2026 14:56:57 +0000 Subject: [PATCH 5/6] Remove running on push and schedule, since PR info is not available there --- .github/workflows/test-check-pr-title.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test-check-pr-title.yml b/.github/workflows/test-check-pr-title.yml index c85b1f7..2dcdbde 100644 --- a/.github/workflows/test-check-pr-title.yml +++ b/.github/workflows/test-check-pr-title.yml @@ -1,11 +1,7 @@ on: pull_request: types: [opened, edited, reopened, synchronize] - push: - branches: [main] workflow_dispatch: - schedule: - - cron: "0 8 * * *" jobs: test-check-pr-title: From 15afafb54e09b7b890eee57f52e897a25432b7bb Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 6 Mar 2026 16:55:12 +0000 Subject: [PATCH 6/6] Add default shell --- .github/workflows/check-pr-title.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index 41dd06d..5767c9e 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -3,6 +3,10 @@ name: Check PR title on: workflow_call: +defaults: + run: + shell: bash + jobs: check_title: runs-on: ubuntu-latest