1
0
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:
rxu 2021-01-05 21:46:51 +07:00
parent 82da2e133b
commit 937305bc41
No known key found for this signature in database
GPG Key ID: 955F0567380E586A
2 changed files with 16 additions and 4 deletions

View File

@ -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:

View File

@ -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"