Skip to content

Commit fc2375f

Browse files
feat: support branches that merge from main to develop (#102)
1 parent fde6921 commit fc2375f

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ SEMANTIC_PREFIXES="^(feat|fix|chore|docs|style|refactor|perf|test)[(:]"
6868
JIRA_TICKET="([A-Z]+-[0-9]+)"
6969
VERSION_REGEX="v([0-9]+)\.([0-9]+)\.([0-9]+)"
7070

71+
if [ "$PR_BRANCH" == "main" ] && [ "$TARGET_BRANCH" == "develop" ]; then
72+
echo "Everything is good"
73+
exit 0
74+
fi
75+
7176
if [[ "$TARGET_BRANCH" == "develop" ]] || [[ "$TARGET_BRANCH" =~ ^release/v ]] || [[ "$TARGET_BRANCH" =~ ^hotfix/v ]]; then
7277
if [[ "$PR_BRANCH" =~ ^release/v ]] || [[ "$PR_BRANCH" =~ ^hotfix/v ]]; then
7378
echo "PR title and branch name validation passed."

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,21 @@ export PR_TITLE="hotfix v1.2.3 to main"
277277
# WHEN
278278
ACTUAL="$($SCRIPT_DIR/validate_pr.sh)"
279279

280+
# THEN
281+
expect "$?" "0"
282+
283+
echo Scenario: Valid main branch to develop branch
284+
beforeEach
285+
286+
# GIVEN
287+
export PR_BRANCH="main"
288+
export TARGET_BRANCH="develop"
289+
export PACKAGE_VERSION="1.18.2"
290+
export LATEST_VERSION="1.18.2"
291+
export PR_TITLE="chore: sync main (v1.18.2) to develop"
292+
293+
# WHEN
294+
ACTUAL="$($SCRIPT_DIR/validate_pr.sh)"
295+
280296
# THEN
281297
expect "$?" "0"

0 commit comments

Comments
 (0)