comment-cc #2713
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Commenting on a conventional commit lint failure is done in a separate workflow | |
# to fix the permission issues with workflows run from forks. | |
# | |
# This workflow runs only when the other workflow runs (including if it fails) | |
# | |
name: comment-cc | |
on: | |
workflow_run: | |
workflows: | |
- lint-cc | |
types: | |
- completed | |
permissions: | |
contents: read | |
# Leave a comment on PRs that fail conventional commits | |
jobs: | |
comment: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Explain conventional commits in comment | |
uses: marocchino/sticky-pull-request-comment@daa4a82a0a3f6c162c02b83fa44b3ab83946f7cb | |
with: | |
# Since lint-conventional-commits runs on pull requests, we should have exactly one | |
# pull request on the original workflow run, which we can reference the number of | |
number: ${{ github.event.workflow_run.pull_requests[0].number }} | |
header: tip-conventional-commits | |
# If the workflow is now successful, we can delete the original message | |
delete: ${{ github.event.workflow_run.conclusion == 'success' }} | |
# If the workflow failed, we should create the message | |
recreate: ${{ github.event.workflow_run.conclusion != 'success' }} | |
message: | | |
<h3> | |
:warning: It looks like your commit is not formatted in line with [Conventional Commits][cc] | |
</h3> | |
The [wasmCloud][wasmcloud] project uses Conventional Commits to enable automation and ensure consistent commit messages across the project. | |
If you're feeling adventurous, amend/interactively rebase your commits to match the conventional commit standard. | |
For example, if you added a feature to the wasmCloud host: | |
```console | |
git amend -m "feat(host): your awesome new feature title here" | |
``` | |
If you don't feel comfortable doing this, don't worry -- a project maintainer will help correct this for you, before merging. | |
[cc]: https://www.conventionalcommits.org/en/v1.0.0 | |
[wasmcloud]: https://github.com/wasmCloud |