@@ -41,49 +41,32 @@ expect "$ACTUAL" "Error: Invalid PR title format
4141Details:
4242- Current title: This is a PR title (ISSUE-1234)
4343Action: Update the PR title to start with a valid semantic prefix
44- Valid prefixes: feat:, fix:, chore:, docs:, style:, refactor:, perf:, test:
45- Example: feat: Add new feature (ABC-123)
44+ Valid prefixes: feat:, fix:, chore:, ci:, docs:, style:, refactor:, perf:, test:
45+ Examples:
46+ feat(ABC-123): Add new feature
47+ docs: correct misspelling in readme
4648Note: You must push a new commit to update this validation result"
4749
48- echo Scenario: PR title missing Jira ticket for feature branch
49- beforeEach
50-
51- # GIVEN
52- export PR_TITLE=" feat: This is a PR title"
5350
54- # WHEN
55- ACTUAL=" $( $SCRIPT_DIR /validate_pr.sh) "
56-
57- # THEN
58- expect " $? " " 1"
59- expect " $ACTUAL " " Error: Missing Jira ticket reference in PR title
60- Details:
61- - Current title: feat: This is a PR title
62- Action: Include a Jira ticket ID in the PR title using the format (ABC-123)
63- Example: feat: Add new feature (ABC-123)"
6451
65- echo Scenario: PR title missing Jira ticket for feature branch targeting hotfix branch
52+ echo Scenario: Valid PR title for feature branch
6653beforeEach
6754
6855# GIVEN
69- export PR_TITLE=" feat: This is a PR title"
56+ export PR_TITLE=" feat: This is a PR title (ISSUE-1234) "
7057
7158# WHEN
7259ACTUAL=" $( $SCRIPT_DIR /validate_pr.sh) "
7360
7461# THEN
75- expect " $? " " 1"
76- expect " $ACTUAL " " Error: Missing Jira ticket reference in PR title
77- Details:
78- - Current title: feat: This is a PR title
79- Action: Include a Jira ticket ID in the PR title using the format (ABC-123)
80- Example: feat: Add new feature (ABC-123)"
62+ expect " $? " " 0"
63+ expect " PR title and branch name validation passed." " $ACTUAL "
8164
82- echo Scenario: Valid PR title for feature branch
65+ echo Scenario: Valid PR title without Jira ticket for feature branch
8366beforeEach
8467
8568# GIVEN
86- export PR_TITLE=" feat: This is a PR title (ISSUE-1234) "
69+ export PR_TITLE=" feat: This is a PR title without ticket "
8770
8871# WHEN
8972ACTUAL=" $( $SCRIPT_DIR /validate_pr.sh) "
0 commit comments