mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[CI] Complete upmerge action successfully even if there are no changes between branches
This commit is contained in:
parent
3eca63e686
commit
7a3d29c98c
1 changed files with 19 additions and 0 deletions
19
.github/workflows/upmerge_pr.yaml
vendored
19
.github/workflows/upmerge_pr.yaml
vendored
|
|
@ -51,8 +51,22 @@ jobs:
|
|||
git fetch origin ${{ matrix.base_branch }}:${{ matrix.base_branch }}
|
||||
git reset --hard ${{ matrix.base_branch }}
|
||||
|
||||
-
|
||||
name: Check for changes between branches
|
||||
id: check_diff
|
||||
run: |
|
||||
git fetch origin ${{ matrix.target_branch }}:${{ matrix.target_branch }}
|
||||
if git diff --quiet ${{ matrix.target_branch }}; then
|
||||
echo "No changes detected."
|
||||
echo "no_changes=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "Changes detected."
|
||||
echo "no_changes=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
-
|
||||
name: Create Pull Request
|
||||
if: env.no_changes == 'false'
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ secrets.SYLIUS_BOT_PAT }}
|
||||
|
|
@ -76,3 +90,8 @@ jobs:
|
|||
branch: "upmerge/${{ matrix.base_branch }}_${{ matrix.target_branch }}"
|
||||
delete-branch: true
|
||||
base: ${{ matrix.target_branch }}
|
||||
|
||||
-
|
||||
name: No changes found
|
||||
if: env.no_changes == 'true'
|
||||
run: echo "No changes between ${{ matrix.base_branch }} and ${{ matrix.target_branch }}. Skipping PR creation."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue