Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch clone update #4

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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