mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-16 13:48:58 +01:00
[ticket/16675] Restore commit message checks
PHPBB3-16675
This commit is contained in:
parent
82da2e133b
commit
937305bc41
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@ -26,6 +26,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 100
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
@ -76,11 +78,11 @@ jobs:
|
||||
|
||||
- name: Check commit message
|
||||
env:
|
||||
BRANCH: ${{ github.event.pull_request.base.ref }}
|
||||
BRANCH: ${{ github.event.pull_request.base.sha }}
|
||||
PR_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
if: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.base.ref != '' }}
|
||||
if: github.event.pull_request.head.sha != '' && github.event.pull_request.base.sha != ''
|
||||
run: |
|
||||
git remote set-branches --add origin $BRANCH && git fetch && git-tools/commit-msg-hook-range.sh origin/$BRANCH..$PR_SHA
|
||||
git-tools/commit-msg-hook-range.sh $BRANCH..$PR_SHA
|
||||
|
||||
# Tests for MySQL and MariaDB
|
||||
mysql-tests:
|
||||
|
@ -24,7 +24,17 @@ COMMIT_MSG_HOOK_FATAL=$(git config --bool phpbb.hooks.commit-msg.fatal 2> /dev/n
|
||||
git config phpbb.hooks.commit-msg.fatal true
|
||||
|
||||
EXIT_STATUS=0
|
||||
for COMMIT_HASH in $(git rev-list --no-merges "$COMMIT_RANGE")
|
||||
|
||||
COMMIT_HASHES=$(git rev-list --no-merges "$COMMIT_RANGE")
|
||||
|
||||
# If any message have been returned instead of commit hashes list
|
||||
# send a non-zero exit status upstream.
|
||||
if ! [[ "$COMMIT_HASHES" =~ ^[0-9a-f]{5,40} ]]
|
||||
then
|
||||
EXIT_STATUS=1
|
||||
fi
|
||||
|
||||
for COMMIT_HASH in $COMMIT_HASHES
|
||||
do
|
||||
echo "Inspecting commit message of commit $COMMIT_HASH"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user