Skip to content

Commit 0070545

Browse files
authored
Merge pull request #4 from pimcore/branch_clone_update
Branch clone update
2 parents 7406f98 + c3992cd commit 0070545

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/reusable-clone-branch.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,22 @@ jobs:
4343
git config user.email "$GIT_EMAIL"
4444
git config user.name "$GIT_NAME"
4545
46+
- name: Check for differences
47+
id: diff-check
48+
run: |
49+
git fetch origin
50+
git fetch https://github.com/pimcore/$TARGET_REPO.git
51+
DIFF=$(git diff $TARGET_BRANCH $BASE_BRANCH)
52+
echo "DIFF=$DIFF" >> $GITHUB_OUTPUT
53+
54+
- name: Skip if no differences
55+
if: steps.diff-check.outputs.DIFF == ''
56+
run: |
57+
echo "No differences found. Skipping PR creation." >> $GITHUB_STEP_SUMMARY
58+
exit 0
59+
4660
- name: Prepare base target branch PR in EE repo
61+
if: steps.diff-check.outputs.DIFF != ''
4762
run: |
4863
DESTINATION_BRANCH="$TARGET_BRANCH-from-CE"
4964
echo "DESTINATION_BRANCH=$DESTINATION_BRANCH" >> $GITHUB_ENV
@@ -61,8 +76,9 @@ jobs:
6176
git pull
6277
git checkout -b $DESTINATION_BRANCH
6378
git push $TARGET_REPO $DESTINATION_BRANCH
64-
79+
6580
- name: Create PR in target repo
81+
if: steps.diff-check.outputs.DIFF != ''
6682
run: |
6783
# Create a PR in Repo EE
6884
REQ_BODY=$(cat << EOF
@@ -101,6 +117,7 @@ jobs:
101117
fi
102118
103119
- name: Set label value based on branch name
120+
if: steps.diff-check.outputs.DIFF != ''
104121
run: |
105122
if [[ $TARGET_BRANCH == bugfix_* ]]; then
106123
echo "LABEL=bug" >> $GITHUB_ENV
@@ -111,6 +128,7 @@ jobs:
111128
fi
112129
113130
- name: Set a label on PR
131+
if: steps.diff-check.outputs.DIFF != ''
114132
continue-on-error: true
115133
run: |
116134
# Set a label for PR

0 commit comments

Comments
 (0)