From 4e08fcc69d8ab0be3b373bef40a68d567ae64f96 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 9 Apr 2025 18:34:02 +0200 Subject: [PATCH 1/3] docs: update README with usage and validation rules --- README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a198e3f..a2e4f87 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,37 @@ # pull-request-lint -Lints the title of a pull request \ No newline at end of file +A GitHub/Gitea Action that lints pull request titles to ensure they follow the [Conventional Commits](https://www.conventionalcommits.org/) format. + +## Usage + +Add the following to your GitHub/Gitea workflow: + +```yaml +name: Pull Request Lint + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: your-org/pull-request-lint@main +``` + +## Validation Rules + +The action enforces the following Conventional Commits rules for PR titles: + +- Format must be: `type(scope)!: description` (scope and breaking change marker `!` are optional) +- Type and scope must be lowercase +- Description must start with lowercase +- Breaking change indicator and footer are mutually exclusive +- Body must be separated from description by a blank line +- Footer tokens must use hyphens instead of spaces (except for "BREAKING CHANGE") + +## License + +See [LICENSE](LICENSE) file for details. \ No newline at end of file -- 2.47.2 From e807c3ddb83bc28f1a1830d318b9005e8630394e Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 9 Apr 2025 18:40:14 +0200 Subject: [PATCH 2/3] build: update pull request lint workflow configuration --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a2e4f87..3e3bf1e 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,18 @@ name: Pull Request Lint on: pull_request: - types: [opened, edited, synchronize] + types: [opened, edited, reopened, synchronize] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: your-org/pull-request-lint@main + - name: Install go + uses: actions/setup-go@v5 + with: + go-version: 1.24.2 + - uses: https://git.kjan.de/actions/pull-request-lint@main ``` ## Validation Rules @@ -34,4 +38,4 @@ The action enforces the following Conventional Commits rules for PR titles: ## License -See [LICENSE](LICENSE) file for details. \ No newline at end of file +See [LICENSE](LICENSE) file for details. -- 2.47.2 From 1c435549a6414955814912b56c27af8948304296 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 9 Apr 2025 18:42:45 +0200 Subject: [PATCH 3/3] docs: update pull request lint action version in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e3bf1e..7c7a6db 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.24.2 - - uses: https://git.kjan.de/actions/pull-request-lint@main + - uses: https://git.kjan.de/actions/pull-request-lint@release ``` ## Validation Rules -- 2.47.2