Skip to content

PR TODO Comment

Actions

About

Lists TODO/FIXME statements added in a pull request as a sticky PR comment
v3
Latest
Star (1)

Tags

 (1)

PR TODO Comment

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.

Usage

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@v1

No checkout step is needed — the action reads the diff through the GitHub API.

Inputs

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.

Outputs

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 1

Previewing locally

You 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,HACK

The 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).

Development

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

PR TODO Comment is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Lists TODO/FIXME statements added in a pull request as a sticky PR comment
v3
Latest

Tags

 (1)

PR TODO Comment is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.