Skip to content

Commit 6990a53

Browse files
committed
Enforce PR title to include Jira ticket
1 parent d90b680 commit 6990a53

2 files changed

Lines changed: 31 additions & 6 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ on:
1919

2020
permissions: write-all
2121
jobs:
22-
# Create TestRail run
23-
create-testrail-run:
24-
name: Create TestRail Run
25-
uses: ./.github/workflows/create-testrail-run.yaml
22+
# PR title check
23+
pr-title-check:
24+
name: Check PR title
25+
uses: ./.github/workflows/pr-title-check.yaml
2626
secrets:
2727
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
2828
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
@@ -31,7 +31,7 @@ jobs:
3131
build-and-test:
3232
name: Build and test
3333
uses: ./.github/workflows/build-and-test.yaml
34-
needs: create-testrail-run
34+
needs: pr-title-check
3535
secrets:
3636
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
3737
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -45,7 +45,7 @@ jobs:
4545
name: Integration tests
4646
uses: ./.github/workflows/integration-tests.yaml
4747
if: ${{ vars.ENABLE_INTEGRATION_TESTS == 'true' }}
48-
needs: create-testrail-run
48+
needs: pr-title-check
4949
secrets:
5050
E2E_CONFIG: ${{ secrets.E2E_CONFIG }}
5151
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PR Title Check
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
pr-title-check:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Validate PR title starts with Jira key
11+
shell: bash
12+
run: |
13+
set -euo pipefail
14+
TITLE="${{ github.event.pull_request.title }}"
15+
echo "PR title: $TITLE"
16+
17+
# Require: SDKS-<digits> <space> <anything>
18+
PATTERN='^SDKS-[0-9]+[[:space:]].+'
19+
20+
if [[ ! "$TITLE" =~ $PATTERN ]]; then
21+
echo "::error::PR title must start with 'SDKS-<number> ' (example: 'SDKS-4770 Aligning storage strategy with Android')."
22+
exit 1
23+
fi
24+
25+
echo "Title OK"

0 commit comments

Comments
 (0)