Skip to content

Commit

Permalink
Merge pull request #4 from pimcore/branch_clone_update
Browse files Browse the repository at this point in the history
Branch clone update
  • Loading branch information
bluvulture authored Nov 23, 2023
2 parents 7406f98 + c3992cd commit 0070545
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/reusable-clone-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ jobs:
git config user.email "$GIT_EMAIL"
git config user.name "$GIT_NAME"
- name: Check for differences
id: diff-check
run: |
git fetch origin
git fetch https://github.com/pimcore/$TARGET_REPO.git
DIFF=$(git diff $TARGET_BRANCH $BASE_BRANCH)
echo "DIFF=$DIFF" >> $GITHUB_OUTPUT
- name: Skip if no differences
if: steps.diff-check.outputs.DIFF == ''
run: |
echo "No differences found. Skipping PR creation." >> $GITHUB_STEP_SUMMARY
exit 0
- name: Prepare base target branch PR in EE repo
if: steps.diff-check.outputs.DIFF != ''
run: |
DESTINATION_BRANCH="$TARGET_BRANCH-from-CE"
echo "DESTINATION_BRANCH=$DESTINATION_BRANCH" >> $GITHUB_ENV
Expand All @@ -61,8 +76,9 @@ jobs:
git pull
git checkout -b $DESTINATION_BRANCH
git push $TARGET_REPO $DESTINATION_BRANCH
- name: Create PR in target repo
if: steps.diff-check.outputs.DIFF != ''
run: |
# Create a PR in Repo EE
REQ_BODY=$(cat << EOF
Expand Down Expand Up @@ -101,6 +117,7 @@ jobs:
fi
- name: Set label value based on branch name
if: steps.diff-check.outputs.DIFF != ''
run: |
if [[ $TARGET_BRANCH == bugfix_* ]]; then
echo "LABEL=bug" >> $GITHUB_ENV
Expand All @@ -111,6 +128,7 @@ jobs:
fi
- name: Set a label on PR
if: steps.diff-check.outputs.DIFF != ''
continue-on-error: true
run: |
# Set a label for PR
Expand Down

0 comments on commit 0070545

Please sign in to comment.