A GitHub Action that lists all TODO and FIXME statements added or modified in a pull request as a single sticky PR comment.
- Scans only the lines added in the PR diff — pre-existing TODOs elsewhere in the codebase are ignored.
- Keeps one comment per PR, updated in place on every run.
- Deletes the comment automatically once all TODOs are removed from the diff.
- Each finding links to the exact file and line at the PR's head commit.
name: TODO check
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
pull-requests: write
jobs:
todos:
runs-on: ubuntu-latest
steps:
- uses: includable/todo-comment-action@v1No checkout step is needed — the action reads the diff through the GitHub API.
| Input | Default | Description |
|---|---|---|
token |
${{ github.token }} |
Token with pull-requests: write permission. |
keywords |
TODO,FIXME |
Comma-separated keywords, matched case-insensitively as whole words. |
comment-header |
📝 TODO / FIXME items in this PR |
Heading shown at the top of the comment. |
| Output | Description |
|---|---|
count |
Number of matching lines found in the PR diff. |
For example, to fail the build when TODOs are present:
- uses: includable/todo-comment-action@v1
id: todos
- if: steps.todos.outputs.count > 0
run: echo "::error::PR contains ${{ steps.todos.outputs.count }} TODO(s)" && exit 1You can render the comment for any PR without posting anything:
node bin/preview.js https://github.com/owner/repo/pull/123
node bin/preview.js owner/repo 123 --keywords TODO,FIXME,HACKThe comment markdown is printed to stdout. Authentication uses $GITHUB_TOKEN / $GH_TOKEN if set, falling back to gh auth token; public repos work unauthenticated (rate-limited).
The diff parsing and comment rendering live in src/todo-comment.js, shared by the action (action.yml, via actions/github-script) and the local preview CLI. Run the tests with:
npm test