Skip to content

includable/todo-comment-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors