Skip to content

Commit

Permalink
fixup! ci: prevent accidental merge of fixup! commits
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed May 17, 2024
1 parent 18694d6 commit 331227d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/check-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Validate commit messages
on:
push:

jobs:
prevent-fixup-commits:
name: Check for fixup! commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Check for fixup! commits
run: |
git fetch origin
git status
git log main..HEAD
git --pretty=format:%s log main..HEAD | grep -ie '^fixup!' && exit 1 || true
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,7 @@ on:
branches: [ main ]

jobs:
prevent-fixup-commits:
name: Check for fixup! commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Check for fixup! commits
run: |
git fetch origin
git status
git log main..HEAD
git log main..HEAD | grep -ie '^ fixup!' && exit 1 || true
build:
needs: prevent-fixup-commits
name: build (${{ matrix.os }})
strategy:
matrix:
Expand Down

0 comments on commit 331227d

Please sign in to comment.