Skip to content

A GitHub Action that automatically creates, updates, and closes GitHub issues from TODO comments in your code. Never lose track of your TODOs again!

Notifications You must be signed in to change notification settings

VeVarunSharma/todo-issueops

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

Repository files navigation

πŸ€– TODO IssueOps

GitHub Marketplace Docker TypeScript MIT License

A GitHub Action that automatically creates, updates, and closes GitHub issues from TODO comments in your code. Never lose track of your TODOs again!

✨ Features

  • πŸ” Automatic TODO Detection - Scans code changes for TODO/FIXME comments
  • πŸ“ Issue Creation - Creates GitHub issues for new TODO comments
  • πŸ”„ Issue Management - Automatically closes issues when TODOs are removed
  • 🚫 Duplicate Prevention - Uses fingerprinting to avoid duplicate issues
  • πŸ”— Direct Code Links - Issues include links to the exact code location
  • 🏷️ Customizable Labels - Add custom labels and assignees to issues
  • 🌐 Multi-Language Support - Works with any programming language

πŸš€ Quick Start

Add this action to your workflow file (.github/workflows/todo-issueops.yml):

name: 'TODO IssueOps'
on:
  pull_request:
    types: [opened, synchronize] # Runs when a PR is opened or updated

jobs:
  track_todos:
    runs-on: ubuntu-latest
    steps:
      - name: 'Checkout Code'
        uses: actions/checkout@v4

      - name: 'Run TODO IssueOps'
        uses: vesharma-dev/todo-issueops@v1.0.4 # Use your GitHub username and the new tag
        with:
          # The default token is sufficient for most cases
          token: ${{ secrets.GITHUB_TOKEN }}
          # Optional: customize keywords, labels, or assignees
          # keywords: 'TODO,FIXME,HACK,NOTE'
          # labels: 'todo, needs-attention'
          # assignees: 'vesharma-dev'

πŸ“– How It Works

1. Code Scanning

When you push code, TODO Bot analyzes the git diff to identify:

  • βœ… New TODO comments - Creates issues
  • ❌ Removed TODO comments - Closes corresponding issues

2. Comment Recognition

Supports multiple comment styles across languages:

// TODO: Add user authentication
/* TODO: Optimize database queries */
# TODO: Implement error handling
# FIXME: Handle edge case when list is empty
<!-- TODO: Add responsive design -->

3. Issue Management

Each TODO becomes a GitHub issue with:

  • Title: The TODO content
  • Body: File location, line number, and direct code link
  • Labels: Configurable (default: todo-issueops)
  • Fingerprinting: SHA-256 hash prevents duplicates

βš™οΈ Configuration

Inputs

Parameter Description Required Default
token GitHub token for API access βœ… ${{ github.token }}
keywords Comma-separated keywords to search for ❌ TODO,FIXME
labels Comma-separated labels for new issues ❌ todo-issueops
assignees Comma-separated GitHub usernames ❌ none

Example Configurations

Minimal Setup

- name: TODO Bot
  uses: vesharma-dev/todo-issueops@v1

Advanced Setup

- name: TODO Bot
  uses: vesharma-dev/todo-issueops@v1
  with:
    keywords: 'TODO,FIXME,HACK,NOTE,BUG'
    labels: 'todo-issueops,technical-debt,enhancement'
    assignees: 'developer1,developer2'

πŸ› οΈ Development & Testing

Prerequisites

# Install dependencies
brew install act docker
pnpm install

Quick Setup

# Build TypeScript
pnpm build

# Test locally (syntax only)
pnpm run manual-test

# Test with GitHub Actions emulator
pnpm run emulator

Available Scripts

Script Command Description
Manual Test pnpm run manual-test Tests TypeScript logic with mock data
Emulator pnpm run emulator Interactive menu for full workflow testing with act
Build pnpm build Compiles TypeScript to dist/
Clean pnpm run clean Removes build artifacts

Testing Options

1. Quick Logic Test

pnpm run manual-test
  • βœ… Tests TypeScript compilation and parsing
  • βœ… Uses mock GitHub data (safe, no API calls)
  • βœ… Validates input handling and TODO detection

2. Full Workflow Test

pnpm run emulator

Interactive menu with options:

  1. Create test commit - Sets up git repo with test TODO files
  2. Run basic act test - Tests workflow without real GitHub API
  3. Run with GitHub token - Tests with real GitHub API calls
  4. Simulate TODO changes - Tests adding/removing TODOs
  5. Build Docker image - Tests containerization
  6. Debug build issues - Troubleshooting tools

3. Real GitHub API Testing

For testing with actual GitHub API:

  1. Create Personal Access Token:

  2. Add token to .secrets file:

    echo 'GITHUB_TOKEN=ghp_your_token_here' > .secrets
  3. Run emulator and choose option 3

Project Structure

todo-issueops/
β”œβ”€β”€ src/index.ts          # Main TypeScript logic
β”œβ”€β”€ dist/                 # Compiled JavaScript
β”œβ”€β”€ scripts/              # Testing scripts
β”œβ”€β”€ test-files/           # Sample files with TODOs
β”œβ”€β”€ action.yml           # GitHub Action metadata
β”œβ”€β”€ Dockerfile           # Container configuration
└── .secrets             # Local GitHub token (gitignored)

Common Issues & Solutions

Issue Solution
act not found brew install act
Docker not running Start Docker Desktop
Permission denied chmod +x scripts/*.sh
TypeScript errors pnpm build to check compilation
Platform errors Use option 6 in emulator for debug build

Development Workflow

  1. Edit code in src/index.ts
  2. Test logic: pnpm run manual-test
  3. Test workflow: pnpm run emulator β†’ option 2
  4. Test with real API: Use option 3 with .secrets file

πŸ“‹ Example Workflow

Before - Your Code

// src/api.ts
export async function fetchUsers() {
  // TODO: Add pagination support
  // FIXME: Handle network errors properly
  return fetch('/api/users');
}

After Push - Generated Issue

Issue #42: "TODO: Add pagination support"

This issue was automatically created from a TODO comment in the code.

**File:** `src/api.ts`
**Line:** 3
**TODO:** TODO: Add pagination support

**Link to code:** [View in repository](https://github.com/your-repo/blob/abc123/src/api.ts#L3)

---

_This issue is managed by TODO Bot. Do not edit the fingerprint below._

<!-- todo-issueops-FINGERPRINT: a1b2c3d4e5f6g7h8 -->

When TODO Removed - Auto-closed

The issue gets automatically closed with a comment explaining the TODO was removed.

πŸ”§ Advanced Usage

Custom Keywords

keywords: 'TODO,FIXME,HACK,BUG,OPTIMIZE,REFACTOR,SECURITY'

Branch-Specific

on:
  push:
    branches: [main]
    paths: ['**.ts', '**.js', '**.py']

Multiple Workflows

Create separate workflows for different teams:

  • todo-issueops-critical.yml - Urgent TODOs
  • todo-issueops-frontend.yml - UI-related TODOs
  • todo-issueops-backend.yml - API-related TODOs

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Test your changes (pnpm run manual-test && pnpm run emulator)
  4. Commit changes (git commit -m 'Add amazing feature')
  5. Push and open a Pull Request

πŸ“„ License

MIT License - see LICENSE for details.

πŸ“ž Support


Made with ❀️ for developers who love organized code

Example Configurations

Minimal Setup

- name: TODO Bot
  uses: vesharma-dev/todo-issueops@v1

Advanced Setup

- name: TODO Bot
  uses: vesharma-dev/todo-issueops@v1
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    keywords: 'TODO,FIXME,HACK,NOTE,BUG'
    labels: 'todo-issueops,technical-debt,enhancement'
    assignees: 'developer1,developer2,team-lead'

Team-Specific Setup

- name: Frontend TODOs
  uses: vesharma-dev/todo-issueops@v1
  with:
    keywords: 'TODO,FIXME'
    labels: 'frontend,todo-issueops'
    assignees: 'frontend-team-lead'

- name: Backend TODOs
  uses: vesharma-dev/todo-issueops@v1
  with:
    keywords: 'TODO,FIXME,OPTIMIZE'
    labels: 'backend,todo-issueops'
    assignees: 'backend-team-lead'

πŸ› οΈ Development

Prerequisites

  • Node.js 22+
  • pnpm
  • Docker

Setup

# Clone the repository
git clone https://github.com/vesharma-dev/todo-issueops.git
cd todo-issueops

# Install dependencies
pnpm install

# Build TypeScript
pnpm build

# Run tests
pnpm test

Project Structure

todo-issueops/
β”œβ”€β”€ src/
β”‚   └── index.ts          # Main application logic
β”œβ”€β”€ lib/                  # Compiled JavaScript (generated)
β”œβ”€β”€ action.yml           # GitHub Action metadata
β”œβ”€β”€ Dockerfile           # Container configuration
β”œβ”€β”€ package.json         # Dependencies and scripts
β”œβ”€β”€ tsconfig.json        # TypeScript configuration
└── README.md           # This file

Building

# Compile TypeScript
pnpm build

# Build Docker image
docker build -t todo-issueops .

# Test locally
docker run --rm todo-issueops

πŸ“‹ Example Workflow

Here's what happens when you commit code with TODOs:

1. Before - Your Code

// src/api.ts
export async function fetchUsers() {
  // TODO: Add pagination support
  // FIXME: Handle network errors properly
  return fetch('/api/users');
}

2. After Push - Generated Issues

Issue #42: "TODO: Add pagination support"

This issue was automatically created from a TODO comment in the code.

**File:** `src/api.ts`
**Line:** 3
**TODO:** TODO: Add pagination support

**Link to code:** [View in repository](https://github.com/your-repo/blob/abc123/src/api.ts#L3)

---

_This issue is managed by TODO Bot. Do not edit the fingerprint below._

<!-- todo-issueops-FINGERPRINT: a1b2c3d4e5f6g7h8 -->

3. When TODO is Removed - Auto-closed

The issue gets automatically closed with a comment explaining the TODO was removed.

πŸ§ͺ Local Development & Testing

Prerequisites

  • Docker Desktop installed and running
  • Node.js 22+ and pnpm
  • act tool for local GitHub Actions testing

Quick Setup

# Install act (macOS)
brew install act

# Install dependencies
pnpm install

# Build TypeScript
pnpm build

Testing Options

1. Full Workflow Testing with act (Recommended)

Test the complete GitHub Action workflow locally:

# Use the interactive testing script
./local-test.sh

# Or run act directly
act push -W .github/workflows/dev-test.yml

2. Manual Logic Testing

Test just the TypeScript logic without GitHub Actions:

# Quick syntax and logic test
./manual-test.sh

# Or run directly with mock environment
pnpm build && node lib/index.js

3. Docker Testing

Test the Docker container locally:

# Build Docker image
docker build -t todo-issueops-local .

# Run container (requires environment setup)
docker run --rm -e INPUT_TOKEN=test todo-issueops-local

Testing with Real GitHub API

To test with actual GitHub API calls:

  1. Create a Personal Access Token in GitHub (Settings β†’ Developer settings β†’ Personal access tokens)
  2. Run with token:
    act push -s GITHUB_TOKEN=your_token_here

Test Files Structure

test-files/
β”œβ”€β”€ user-service.js     # JavaScript with TODO comments
β”œβ”€β”€ data_processor.py   # Python with FIXME comments
└── (add your own test files)

Debugging Tips

  1. Enable debug output:

    act push --verbose
  2. Check Docker logs:

    docker logs <container_id>
  3. Validate action.yml:

    act --list  # Should show your workflows
  4. Test specific events:

    act pull_request  # Test PR events
    act push          # Test push events

πŸ”§ Advanced Usage

Custom Keywords

Track different types of technical debt:

keywords: 'TODO,FIXME,HACK,BUG,OPTIMIZE,REFACTOR,SECURITY'

Environment-Specific TODOs

# Only run on main branch
on:
  push:
    branches: [ main ]

# Only for specific file types
on:
  push:
    paths:
      - '**.ts'
      - '**.js'
      - '**.py'

Multiple Workflows

Create separate workflows for different teams or priorities:

  • todo-issueops-critical.yml - For urgent TODOs
  • todo-issueops-frontend.yml - For UI-related TODOs
  • todo-issueops-backend.yml - For API-related TODOs

Development Guidelines

  • Write TypeScript with strict typing
  • Add tests for new features
  • Update documentation
  • Follow conventional commit messages

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with GitHub Actions Toolkit
  • Inspired by the need to never lose track of TODOs again
  • Thanks to the open source community for feedback and contributions

πŸ“ž Support


Made with ❀️ for developers who love organized code

About

A GitHub Action that automatically creates, updates, and closes GitHub issues from TODO comments in your code. Never lose track of your TODOs again!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •