Skip to content

comment-cc

comment-cc #1615

Workflow file for this run

#
# 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@44e0bad81007ecff41ba26d1cbf49a0267d28e9d
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