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

Tmp test changes #8

Merged
merged 3 commits into from
Feb 26, 2025
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
8 changes: 7 additions & 1 deletion .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
id: check_branch
run: |
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
git ls-remote --heads https://${{ secrets.REPOSITORY_TOKEN }}@github.com/adskyiproger/poc-core-test-my.git "$BASE_BRANCH"
if git ls-remote --heads https://${{ secrets.REPOSITORY_TOKEN }}@github.com/adskyiproger/poc-core-test-my.git "$BASE_BRANCH" | grep "$BASE_BRANCH"; then
echo "branch_exists=true" >> $GITHUB_ENV
else
Expand All @@ -34,6 +35,7 @@ jobs:
if: env.branch_exists == 'true'
run: |
git remote add bar https://${{ secrets.REPOSITORY_TOKEN }}@github.com/adskyiproger/poc-core-test-my.git
git remote -v

- name: Fetch bar repository
if: env.branch_exists == 'true'
Expand All @@ -47,20 +49,24 @@ jobs:
if: env.branch_exists == 'true'
run: |
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
echo "BASE_BRANCH: $BASE_BRANCH"
git checkout $BASE_BRANCH
git pull origin $BASE_BRANCH
git merge bar/$BASE_BRANCH --allow-unrelated-histories || \
(git merge --abort && echo "Merge conflict detected. Creating pull request.")
git status

- name: Pull latest changes from bar before pushing
if: env.branch_exists == 'true' && !failure()
run: |
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
git pull --rebase bar $BASE_BRANCH
git pull --rebase bar $BASE_BRANCH || git status
git status

- name: Push changes to bar repository
if: env.branch_exists == 'true' && !failure()
run: |
git status
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
git push bar $BASE_BRANCH

Expand Down
Loading