Skip to content

chore: Simplify PR lint trigger #737

chore: Simplify PR lint trigger

chore: Simplify PR lint trigger #737

name: Pull request
on:
pull_request:
types:
- opened
- edited
- unlabeled
permissions:
pull-requests: write
jobs:
main:
name: lint PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subjectPattern: ^([A-Z]).+$
subjectPatternError: >
The subject "**{subject}**" must start with an uppercase character.
Example: "Add feature" instead of "add feature"
ignoreLabels: |
bot
dependencies
- uses: marocchino/sticky-pull-request-comment@v2
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
### ⚠️ Invalid Pull Request title
Your PR title must follow the format: `type: Subject` where:
- `type` is one of the conventional commit types (in lowercase)
- `Subject` starts with an uppercase letter
> [!CAUTION]
> ${{ steps.lint_pr_title.outputs.error_message }}
#### Valid examples
- `feat: Add API endpoint for market data`
- `fix: Resolve WebSocket connection issues`
- `chore: Update NuGet dependencies`
<details>
<summary>see more valid examples</summary>
#### Features & fixes
- `feat: Add API endpoint for market data`
- `fix: Resolve WebSocket connection issues`
#### Code quality
- `style: Format trading strategy classes`
- `refactor: Restructure trading engine components`
- `perf: Optimize trade order execution flow`
#### Documentation & testing
- `docs: Update API documentation`
- `test: Add unit tests for sign-in flow`
#### Infrastructure
- `build: Update .NET SDK version to 8.0`
- `ci: Add workflow for performance testing`
- `chore: Update NuGet dependencies`
#### Other
- `revert: Remove faulty market data provider`
See [Conventional Commits](https://www.conventionalcommits.org) for more details.
</details>
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true