From e89c694f97fe97f60e6ec5011be9140e95e8d288 Mon Sep 17 00:00:00 2001 From: Amanda Sternberg Date: Thu, 25 Sep 2025 08:31:08 +0200 Subject: [PATCH] ci: enforce conventional PR titles via GitHub Action --- .github/workflows/semantic-pr.yml | 30 ++++++++++++++++++++++++++++++ CONTRIBUTORS | 1 + README.md | 6 ++++++ 3 files changed, 37 insertions(+) create mode 100644 .github/workflows/semantic-pr.yml diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml new file mode 100644 index 000000000..6da8e1658 --- /dev/null +++ b/.github/workflows/semantic-pr.yml @@ -0,0 +1,30 @@ +name: Check PR title (conventional) + +on: + pull_request: + types: [opened, edited, synchronize, reopened, ready_for_review] + +jobs: + semantic: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + style + refactor + perf + test + build + ci + chore + revert + requireScope: false + subjectPattern: '^[^\s].+' + wip: true diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b03108e16..8ab2bb1e3 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -242,6 +242,7 @@ Lee Doughty <32392044+leedoughty@users.noreply.github.com> memchr Max Romanowski Aldlss +Amanda Sternberg ******************** diff --git a/README.md b/README.md index 04d5603a7..ebb89f85c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ For more information on building and developing, please see [Development](./docs Want to contribute to Anki? Check out the [Contribution Guidelines](./docs/contributing.md). +When opening a pull request, please make sure the PR title follows the +[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style. +Examples: + - `feat: add new learning mode` + - `fix: avoid crash when merging notetypes` + ### Anki Contributors [CONTRIBUTORS](./CONTRIBUTORS)