mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-11 19:30:00 +01:00
[ticket/17394] Check mergeability of 3.3.x PRs
PHPBB-17394
This commit is contained in:
parent
bf4e26a0b8
commit
7a21119d17
51
.github/workflows/tests.yml
vendored
51
.github/workflows/tests.yml
vendored
@ -596,3 +596,54 @@ jobs:
|
|||||||
if: ${{ matrix.type == 'functional' }}
|
if: ${{ matrix.type == 'functional' }}
|
||||||
run: |
|
run: |
|
||||||
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional
|
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional
|
||||||
|
|
||||||
|
merge-check:
|
||||||
|
if: github.event.pull_request.base.ref == '3.3.x'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Ensure full history is fetched
|
||||||
|
|
||||||
|
- name: Set up Git user
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions"
|
||||||
|
git config --global user.email "github-actions@github.com"
|
||||||
|
|
||||||
|
- name: Fetch all branches
|
||||||
|
run: git fetch origin
|
||||||
|
|
||||||
|
- name: Simulate merging PR into 3.3.x
|
||||||
|
id: simulate_merge
|
||||||
|
run: |
|
||||||
|
git checkout 3.3.x
|
||||||
|
git merge --no-ff ${{ github.event.pull_request.head.sha }} --no-commit --no-ff || exit 1
|
||||||
|
|
||||||
|
- name: Attempt to merge updated 3.3.x into master
|
||||||
|
id: merge_master
|
||||||
|
run: |
|
||||||
|
git checkout master
|
||||||
|
if git merge --no-ff origin/3.3.x --no-commit --no-ff; then
|
||||||
|
echo "::set-output name=mergeable::true"
|
||||||
|
else
|
||||||
|
echo "::set-output name=mergeable::false"
|
||||||
|
git merge --abort
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Post comment on PR
|
||||||
|
if: always() # Ensure this step always runs, regardless of merge result
|
||||||
|
uses: peter-evans/create-or-update-comment@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
body: |
|
||||||
|
The attempt to merge branch `3.3.x` into `master` has completed after considering the changes in this PR.
|
||||||
|
|
||||||
|
- Merge result: ${{ steps.merge_master.outputs.mergeable == 'true' && 'Success' || 'Conflict' }}
|
||||||
|
|
||||||
|
If there is a conflict, a separate PR will be needed to merge `3.3.x` into `master`.
|
||||||
|
|
||||||
|
- name: Mark job as succeeded
|
||||||
|
if: always()
|
||||||
|
run: echo "Merge check completed. Ignoring the result to avoid failed status."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user