mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #6717 from marc1706/ticket/17396
[ticket/17396] Add workflow for merging 3.3.x into master
This commit is contained in:
commit
b574a0294c
3 changed files with 105 additions and 61 deletions
60
.github/workflows/check_merge_to_master.yml
vendored
Normal file
60
.github/workflows/check_merge_to_master.yml
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
name: Check merge to master
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [ opened, synchronize, reopened ]
|
||||||
|
branches:
|
||||||
|
- 3.3.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
merge-check:
|
||||||
|
if: github.event_name == 'pull_request_target' && 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 fetch origin pull/${{ github.event.pull_request.number }}/head
|
||||||
|
git merge --no-ff FETCH_HEAD || 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; then
|
||||||
|
echo "mergeable=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "mergeable=false" >> $GITHUB_OUTPUT
|
||||||
|
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 ❌' }}
|
||||||
|
|
||||||
|
${{ steps.merge_master.outputs.mergeable == 'true' && 'This PR is ready to be merged.' || '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."
|
45
.github/workflows/merge_3.3.x_to_master.yml
vendored
Normal file
45
.github/workflows/merge_3.3.x_to_master.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
name: Merge 3.3.x into master
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 3.3.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
merge-branch:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Fetch the latest commit information
|
||||||
|
id: get-commit-info
|
||||||
|
run: |
|
||||||
|
# Get the latest commit SHA and its author details
|
||||||
|
COMMIT_SHA=$(git rev-parse HEAD)
|
||||||
|
COMMIT_AUTHOR_NAME=$(git log -1 --pretty=format:'%an' $COMMIT_SHA)
|
||||||
|
COMMIT_AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae' $COMMIT_SHA)
|
||||||
|
|
||||||
|
# Save them as output for later steps
|
||||||
|
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_ENV
|
||||||
|
echo "commit_author_name=$COMMIT_AUTHOR_NAME" >> $GITHUB_ENV
|
||||||
|
echo "commit_author_email=$COMMIT_AUTHOR_EMAIL" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Set up Git with the pull request author's info
|
||||||
|
run: |
|
||||||
|
git config --global user.name "${{ env.commit_author_name }}"
|
||||||
|
git config --global user.email "${{ env.commit_author_email }}"
|
||||||
|
|
||||||
|
- name: Fetch all branches
|
||||||
|
run: git fetch --all
|
||||||
|
|
||||||
|
- name: Merge 3.3.x into master
|
||||||
|
run: |
|
||||||
|
git checkout master
|
||||||
|
git merge --no-ff 3.3.x
|
||||||
|
|
||||||
|
- name: Push changes to master
|
||||||
|
run: git push origin master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
61
.github/workflows/tests.yml
vendored
61
.github/workflows/tests.yml
vendored
|
@ -13,16 +13,10 @@ on:
|
||||||
- 3.3.x
|
- 3.3.x
|
||||||
- master
|
- master
|
||||||
- 'prep-release-*'
|
- 'prep-release-*'
|
||||||
pull_request_target:
|
|
||||||
types: [ opened, synchronize, reopened ]
|
|
||||||
branches:
|
|
||||||
- 3.3.x
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Basic checks, e.g. parse errors, commit messages, etc.
|
# Basic checks, e.g. parse errors, commit messages, etc.
|
||||||
basic-checks:
|
basic-checks:
|
||||||
if: github.event_name != 'pull_request_target'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -94,7 +88,6 @@ jobs:
|
||||||
|
|
||||||
# Tests for MySQL and MariaDB
|
# Tests for MySQL and MariaDB
|
||||||
mysql-tests:
|
mysql-tests:
|
||||||
if: github.event_name != 'pull_request_target'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -238,7 +231,6 @@ jobs:
|
||||||
|
|
||||||
# Tests for PostgreSQL
|
# Tests for PostgreSQL
|
||||||
postgres-tests:
|
postgres-tests:
|
||||||
if: github.event_name != 'pull_request_target'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -359,7 +351,6 @@ jobs:
|
||||||
|
|
||||||
# Other database types, namely sqlite3 and mssql
|
# Other database types, namely sqlite3 and mssql
|
||||||
other-tests:
|
other-tests:
|
||||||
if: github.event_name != 'pull_request_target'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -463,7 +454,6 @@ jobs:
|
||||||
|
|
||||||
# Test with IIS & PostgreSQL on Windows
|
# Test with IIS & PostgreSQL on Windows
|
||||||
windows-tests:
|
windows-tests:
|
||||||
if: github.event_name != 'pull_request_target'
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -606,54 +596,3 @@ 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_name == 'pull_request_target' && 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 }} || 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; then
|
|
||||||
echo "mergeable=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "mergeable=false" >> $GITHUB_OUTPUT
|
|
||||||
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 ❌' }}
|
|
||||||
|
|
||||||
${{ steps.merge_master.outputs.mergeable == 'false' && 'A separate PR will be needed to merge `3.3.x` into `master`.' || 'This PR is ready to be merged.' }}
|
|
||||||
|
|
||||||
- name: Mark job as succeeded
|
|
||||||
if: always()
|
|
||||||
run: echo "Merge check completed. Ignoring the result to avoid failed status."
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue