Skip to content

Commit 854f54c

Browse files
authored
fix(PAR-2812): remove check requiring ticket in title (#105)
1 parent 2ccab5b commit 854f54c

2 files changed

Lines changed: 12 additions & 37 deletions

File tree

.github/actions/validate-pr/validate_pr.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ function compare_versions() {
6565

6666

6767
SEMANTIC_PREFIXES="^(feat|fix|chore|ci|docs|style|refactor|perf|test)[(:]"
68-
JIRA_TICKET="([A-Z]+-[0-9]+)"
6968
VERSION_REGEX="v([0-9]+)\.([0-9]+)\.([0-9]+)"
7069

7170
if [ "$PR_BRANCH" == "main" ] && [ "$TARGET_BRANCH" == "develop" ]; then
@@ -84,19 +83,12 @@ Details:
8483
- Current title: $PR_TITLE
8584
Action: Update the PR title to start with a valid semantic prefix
8685
Valid prefixes: feat:, fix:, chore:, ci:, docs:, style:, refactor:, perf:, test:
87-
Example: feat: Add new feature (ABC-123)
86+
Examples:
87+
feat(ABC-123): Add new feature
88+
docs: correct misspelling in readme
8889
Note: You must push a new commit to update this validation result"
8990
exit 1
9091
fi
91-
92-
if [[ ! "$PR_TITLE" =~ $JIRA_TICKET ]]; then
93-
echo "Error: Missing Jira ticket reference in PR title
94-
Details:
95-
- Current title: $PR_TITLE
96-
Action: Include a Jira ticket ID in the PR title using the format (ABC-123)
97-
Example: feat: Add new feature (ABC-123)"
98-
exit 1
99-
fi
10092
fi
10193

10294
if [[ "$TARGET_BRANCH" == "main" ]]; then

.github/actions/validate-pr/validate_pr_test.sh

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,48 +42,31 @@ Details:
4242
- Current title: This is a PR title (ISSUE-1234)
4343
Action: Update the PR title to start with a valid semantic prefix
4444
Valid prefixes: feat:, fix:, chore:, ci:, docs:, style:, refactor:, perf:, test:
45-
Example: feat: Add new feature (ABC-123)
45+
Examples:
46+
feat(ABC-123): Add new feature
47+
docs: correct misspelling in readme
4648
Note: 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
6653
beforeEach
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
7259
ACTUAL="$($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
8366
beforeEach
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
8972
ACTUAL="$($SCRIPT_DIR/validate_pr.sh)"

0 commit comments

Comments
 (0)