Skip to content

fix: assign-author.yml #14

fix: assign-author.yml

fix: assign-author.yml #14

Workflow file for this run

name: 📢 Check PR Titles
on:
pull_request_target:
types: [opened, reopened, synchronize, edited, ready_for_review]
permissions:
pull-requests: write
jobs:
lint-pr-title:
name: Lint PR title
runs-on: ubuntu-latest
steps:
- name: Lint PR Title
uses: amannn/action-semantic-pull-request@v5
if: ${{ !contains(fromJson('[ "dependabot[bot]", "dependabot-preview[bot]", "imgbot[bot]", "allcontributors" ]'), github.actor) }}
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character.
- name: Comment on PR
uses: marocchino/[email protected]
if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('[ "dependabot[bot]", "dependabot-preview[bot]", "imgbot[bot]", "allcontributors" ]'), github.actor)}}
with:
header: pr-title-lint-error
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
More details 👇🏼
```
${{ steps.lint_pr_title.outputs.error_message}}
```
- name: Delete comment
uses: marocchino/[email protected]
if: ${{ steps.lint_pr_title.outputs.error_message == null }}
with:
header: pr-title-lint-error
delete: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}