Skip to content

Commit 19e1ab5

Browse files
committed
Update pr-checks/post-comment.ts description comment
1 parent f13bcf3 commit 19e1ab5

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

‎pr-checks/post-comment.ts‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
#!/usr/bin/env npx tsx
22

33
/*
4-
Generic CLI for creating or updating a "sticky" PR comment identified by a hidden
5-
HTML-comment marker. This centralizes the gh api logic previously duplicated across PR-check
6-
workflow steps that each managed their own marked comment (e.g. a CHANGELOG.md modification
7-
warning).
8-
9-
The marker is passed explicitly via `--marker` and can be any non-empty string, though an
10-
HTML comment (e.g. `<!-- my-bot -->`) is recommended so it doesn't render visibly. It is used
11-
both to find a pre-existing comment on the pull request to update, and is automatically prepended to
12-
`--body` when posting or updating a comment so that future invocations can find it again.
13-
The `.github/actions/post-comment` action requires callers to supply this value via its
14-
`marker` input.
4+
Creates or updates a pull request comment identified by a marker. The marker
5+
is supplied via `--marker` (or the `.github/actions/post-comment` action's `marker` input)
6+
and must be non-empty. The marker is prepended to `--body` and used to find
7+
the comment on later runs.
8+
9+
Example:
10+
```sh
11+
GH_TOKEN=<token> npx tsx ./pr-checks/post-comment.ts \
12+
--body "The changelog needs updating." \
13+
--marker "<!-- my-bot -->" \
14+
--issue-id 123 \
15+
--repository github/codeql-action
16+
```
1517
*/
1618

1719
import assert from "node:assert/strict";

0 commit comments

Comments
 (0)