Skip to content

Commit

Permalink
Merge branch 'main' into fix/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephigenia authored Jan 2, 2025
2 parents a927cce + a83db2c commit 58c7540
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,40 @@ on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
- labeled
- unlabeled

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
- uses: aslafy-z/[email protected]
with:
success-state: Title follows the specification.
failure-state: Title does not follow the specification.
context-name: conventional-pr-title
preset: conventional-changelog-angular@latest
target-url: https://www.conventionalcommits.org
- id: lint
# SEE https://github.com/amannn/action-semantic-pull-request
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/[email protected]
if: ${{ failure() }}
# do not use user injected variable values directly here as they are
# open to injection attacks
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions
env:
TITLE: ${{ github.event.pull_request.title }}
ERROR: ${{ steps.lint.outputs.error_message }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# javascript
script: |
const output = `The pull-request title "${{ env.TITLE}}" does not apply to [Conventional Commit Guidelines](https://www.conventionalcommits.org).
\`\`\`
${{ env.ERROR }}
\`\`\`
<sub>🤖 This comment was automatically created by the "${{github.workflow}}" workflow.</sup>`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})

0 comments on commit 58c7540

Please sign in to comment.