Skip to content

Commit

Permalink
Add GitHub status check
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Sep 23, 2024
1 parent e556db3 commit d1f7f4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/check-pr-title.yml

This file was deleted.

13 changes: 11 additions & 2 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: guibranco/[email protected]
if: always()
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
state: ${{ (steps.lint_pr_title.outputs.error_message != null) && 'error' || 'success' }}
context: 'conventional-pr-title'
description: PR title ${{ (steps.lint_pr_title.outputs.error_message != null) && 'does not match' || 'matches' }} Conventional Commits spec
sha: ${{ github.event.pull_request.head.sha }}

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
Expand All @@ -27,7 +36,7 @@ jobs:
header: pr-title-lint-error
message: |
Hey there! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Examples of valid PR titles:
Expand All @@ -36,7 +45,7 @@ jobs:
- ci: Add new workflow for linting
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
Expand Down

0 comments on commit d1f7f4d

Please sign in to comment.