File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
1719import assert from "node:assert/strict" ;
You can’t perform that action at this time.
0 commit comments