File tree Expand file tree Collapse file tree
.github/actions/validate-pr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ SEMANTIC_PREFIXES="^(feat|fix|chore|docs|style|refactor|perf|test)[(:]"
6868JIRA_TICKET=" ([A-Z]+-[0-9]+)"
6969VERSION_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+
7176if [[ " $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."
Original file line number Diff line number Diff line change @@ -277,5 +277,21 @@ export PR_TITLE="hotfix v1.2.3 to main"
277277# WHEN
278278ACTUAL=" $( $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
281297expect " $? " " 0"
You can’t perform that action at this time.
0 commit comments