diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index e733545..7617024 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -16,13 +16,17 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 2 # Fetch at least 2 commits to ensure we get non-merge commits - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Validate commit messages run: | - git log --pretty=format:"%s" | head -n 1 | python .github/scripts/validate_commit_msg.py + # Get the last non-merge commit and validate the message + git log --pretty=format:"%s" --no-merges -n 1 | python .github/scripts/validate_commit_msg.py + lint: runs-on: ubuntu-latest