Skip to content

Conversation

Copy link

Copilot AI commented Nov 12, 2025

Adds ability to exclude commits by author during commitlint validation in CI/CD, enabling bot commits (dependabot, renovate, copilot) to bypass conventional commit format requirements.

Changes

  • scripts/filter-commits-by-author.sh: New script that filters commit ranges by author email/name with substring matching. Falls back to standard commitlint when no exclusions specified.

  • .github/workflows/build-and-test.yaml: Modified commitlint step to use filtering script. Reads optional COMMITLINT_EXCLUDED_AUTHORS repository variable (comma-separated author list).

  • scripts/test-filter-commits.sh: Validation tests for filtering logic.

  • README.md: Documentation for configuration and usage.

Configuration

Set repository variable COMMITLINT_EXCLUDED_AUTHORS:

dependabot[bot],renovate[bot],copilot-swe-agent[bot]

Bot commits are excluded; human commits validated as before. Without configuration, all commits validated (backward compatible).

Example Output

./scripts/filter-commits-by-author.sh <base> <head> "dependabot[bot],renovate[bot]"

Excluding commit abc123 from dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Excluding commit def456 from renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Excluded 2 commit(s) from authors matching: dependabot[bot],renovate[bot]

Validating the following commits:
  - 789xyz feat: add new feature (John Developer)
  
Running commitlint on filtered commits...
✔ found 0 problems, 0 warnings
Original prompt

add filter by author


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 12, 2025 20:49
Co-authored-by: alextse-bg <210440419+alextse-bg@users.noreply.github.com>
Add a new script to filter commits by author during commitlint validation in CI/CD workflows. This allows excluding automated commits from bots and tools that may not follow conventional commit message conventions.

Changes:
- Add filter-commits-by-author.sh script to filter commits by author
- Update build-and-test.yaml workflow to use the new filtering script
- Add test script for the commit filtering functionality
- Update README with documentation on how to use the feature

The script supports:
- Filtering by author email or name
- Comma-separated list of authors to exclude
- Fallback to standard commitlint when no filtering is specified
- Configuration via GitHub repository variables

Co-authored-by: alextse-bg <210440419+alextse-bg@users.noreply.github.com>
Copilot AI changed the title [WIP] Add filter functionality by author feat(gha): add author filtering for commitlint validation Nov 12, 2025
Copilot AI requested a review from alextse-bg November 12, 2025 21:02
Copilot finished work on behalf of alextse-bg November 12, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants