Merge pull request #6718 from marc1706/ticket/17396

[ticket/17396] Only try pushing if merge was successful
This commit is contained in:
Marc Alexander 2024-09-18 22:31:45 +02:00 committed by GitHub
commit ba03a05d27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,11 +35,18 @@ jobs:
run: git fetch --all run: git fetch --all
- name: Merge 3.3.x into master - name: Merge 3.3.x into master
# First checkout 3.3.x and master to track from origin, then try merging to master
run: | run: |
git checkout 3.3.x
git checkout master git checkout master
git merge --no-ff 3.3.x if git merge --no-ff 3.3.x; then
echo "merge_failed=false" >> $GITHUB_ENV
else
echo "merge_failed=true" >> $GITHUB_ENV
fi
- name: Push changes to master - name: Push changes to master if merge was successful
if: env.merge_failed == 'false'
run: git push origin master run: git push origin master
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}