mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Add PR/Push specific commit message handling in CI
* The previous ignoring of the top commit was to avoid badly-written merge commits added by github, we want to continue doing that for PRs but check all commits on push as a safety measure.
This commit is contained in:
@@ -23,7 +23,19 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 100
|
||||
- name: Check commit messages
|
||||
- name: Check commit messages (PR)
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: |
|
||||
if git log --oneline | tail -n +2 | head -n 100 | grep -v 76f9176 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
|
||||
(echo -n "::error::";
|
||||
echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information.";
|
||||
echo "Invalid commits:";
|
||||
echo;
|
||||
git log --oneline | tail -n +2 | head -n 100 | grep -v 76f9176 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
|
||||
exit 1;
|
||||
fi
|
||||
- name: Check commit messages (Push)
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
if git log --oneline | head -n 100 | grep -v 76f9176 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
|
||||
(echo -n "::error::";
|
||||
|
||||
Reference in New Issue
Block a user