# .github/commenter.yml
Backend:
where:
path:
matches: "backend/**/*"
body: |
:wave: You've changed Backend code, please:
- [ ] Do this
- [ ] And this
- [ ] And that
Frontend:
where:
path:
matches: "frontend/**/*"
body: |
:wave: You've changed Frontend code, please:
- [ ] Do this
- [ ] And this
- [ ] And thatThe keys are ignored, and for your own organizational use. We will find the
first stanza where the PR's changed files matches any of the given
paths and add a comment with the given body.
- uses: freckle/commenter-action@v1
with:
repo-token:
# The `GITHUB_TOKEN` secret
#
# Required: false
# Default: ${{ github.token }}
configuration-path:
# The path for the comment configurations
#
# Required: false
# Default: .github/commenter.yml
body-file-prefix:
# The path for finding body markdown files
#
# Required: false
# Default: .github/commenter/| name | description | required | default |
|---|---|---|---|
repo-token |
The |
false |
${{ github.token }} |
configuration-path |
The path for the comment configurations |
false |
.github/commenter.yml |
body-file-prefix |
The path for finding body markdown files |
false |
.github/commenter/ |
Running this action requires the following permissions:
permissions:
contents: read
pull-requests: writeThese are required to be explicitly set for repositories with restricted
default access for workflows or to allow a workflow run triggered by
Dependabot pull requests, which are run as if they are from a forked repository
and use a read-only GITHUB_TOKEN.
You can also match based on specific file changes by supplying the
diff where-clause configuration key.
For example, if you wanted to comment on any changes that contain the word "unsafe" you could supply a YAML configuration like the following
UnsafeMentionedInCode:
where:
path:
matches: "backend/**/*.hs"
diff:
contains:
- unsafe
body: |
:wave: Hi, I see a mention of "unsafe" in Haskell code. If you removed it,
good going! If you added it, please consider finding a safer alternative!diff.adds and diff.removes are also supported, to match on specifically
additions or removals of certain text.
Use where.author.any to only comment on PRs that authored by specific users,
and where.labels.any to only comment when specific labels are present. Keep
in mind that all where conditions must be satisfied for a comment to be made:
CommentOnAutomatedUpdate:
where:
path:
matches: "*/**/yarn.lock"
author:
any:
- dependabot[bot]
labels:
any:
- Frontend
body: |
This is an automated update to the frontend lockfile. Please verify the
integrity of the packages being updated.If body is omitted, a file named .github/commenter/{name}.md is read from
the default branch for the comment contents. The .github/commenter/ prefix can
be changed via inputs.body-file-prefix. The complete path, or just the name
part, can be specified via the body-file and body-file-name attributes of
the configuration, respectively.
- Package manager: pnpm (Node version pinned in
.nvmrc) pnpm build—tscthenncc, bundles todist/index.jspnpm test— Vitestpnpm coverage— Vitest with coverage, gated at the levels invitest.config.js(main.tsexcluded: thin wiring, covered by theintegrationCI job instead)pnpm typecheck—tsc --noEmit, includes test filespnpm lint— ESLintpnpm format/pnpm format-check— Prettierpnpm knip— unused files/dependencies/exports- CI runs all of the above on every PR, then runs the built action end to end in the
integrationjob
Versioned tags will exist, such as v1.0.0 and v2.1.1. Tags will also exist
for each major version, such as v1 or v2 and point to the newest version in
that series.
To trigger a release (and update the @v{major} tag), merge a commit to main
that follows Conventional Commits. In short,
fix:to trigger a patch release,feat:to trigger minor, or<type>!:or add aBREAKING CHANGE:trailer to trigger major
We don't enforce conventional commits generally (though you are free do so), it's only required if you want to trigger release.
This action was highly inspired by (and began as a copy of)
@actions/labeler.