🤖 GitHub Action which creates Issues from comments in your code

Overview

todo-issue[action]


Disclosure

Huge thanks to JasonEtco! After he decided to shut down his todo[bot] I've looked around for alternatives but decided to create a new implementation. Parts of his work can be found in this repository.

Usage

The todo-issue action is super easy to use. Once you've set up the action, simply push some code (via commit or pull request). If the code you pushed includes one of the configured keywords (default is TODO), then the action will either create a new, close, update or add a reference to an existing issue for you using the comment you wrote or changed in your code!

If I pushed this:

/**
 * TODO Should we reinvent the wheel here?
 * We already have a good one. But could it be even rounder?
 */
function getWheel() {
    // Returns you this pizza like thing
}

todo-issue would create a new issue:

todo-issue

Note: While the above example is in javascript, todo-issue works in any language as long as you provide a valid styling.

Setup

There are a couple of configuration options in case you need to change the default behaviour.

The defaults are likely fine for most projects, so you might not need to change them.

This yml is a good starting point. You should not tweak the triggers, except for the branch

name: Create issues from TODOs

on:
  workflow_dispatch:
    inputs:
      importAll:
        default: 'false'
        required: false
        type: boolean
        description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing.
  push:
    branches: # do not set multiple branches, todos might be added and then get referenced by themselves in case of a merge
      - main
      - master

permissions:
  issues: write
  repository-projects: read
  contents: read

jobs:
  todos:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Run Issue Bot
        uses: derjuulsn/todo-issue@main
        with:
          excludePattern: '^(node_modules/)'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Available options

Name Type Description Default
autoAssign boolean, string[], string Should todo-issue automatically assign a user to the new issue? If true, it'll assign whoever pushed the code. If a string, it'll assign that user by username. You can also give it an array of usernames or false to not assign anyone. true
keywords string[] The keyword(s) to use to generate issue titles ['TODO']
bodyKeywords string[] If this is in the line right after the main keyword, it will become the generated issue body. []
blobLines number, boolean The number of lines of code to show, starting from the keyword. 5
caseSensitive boolean Should the keyword be case sensitive? true
label boolean, string[] Add a label to the new issue. If true, add the todo label. If false, don't add any label.You can also give it a label name or an array of label names. true
reopenClosed boolean If an issue already exists and is closed, reopen it. Note: if set to false, no new issue will be created. true
excludePattern string Exclude certain files and/or directories. Should be a valid regular expression. null
titleSimilarity number, false Number in percent of similarity which should be used for merging issues on creation. 80

Import all

There is also an option to import all TODOs to GitHub Issues by running the workflow manually in the actions tab.

Note: This can't be undone and should be used super carefully. Don't forget to set your exclude paths in the excludePattern regex.

Styling

There are not many things to pay attention to.

  • In front of a keyword only symbols and whitespace are allowed
  • If you want the body of a comment to be added to the issue, you have to use the exact same characters as in front of the title keyword

For instance this:

//+TODO We have to do something about this
//-there is an error at line 28

would result in a new issue without a body because //+ is not equal to //- (also counts for whitespace!)

Comments
  • Import All not working

    Import All not working

    Hey there! My config looks like this

    name: Create issues for TODOs
    
    on:
      workflow_dispatch:
        inputs:
          importAll:
            default: "false"
            required: false
            type: boolean
            description: Enable, if you want to import all TODOs.
      push:
        branches:
          - development
    
    permissions:
      issues: write
      repository-projects: read
      contents: read
    
    jobs:
      todos:
        runs-on: ubuntu-latest
    
        steps:
          - uses: actions/checkout@v2
    
          - name: Run Issue Bot
            uses: derjuulsn/todo-issue@main
            with:
              excludePattern: "^(mkdocs-material/|src/assets/javascripts/)"
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    
    

    Yet, every time I want to kick off a manual run with import all, it errors with Action can only be used on trigger push or in manual and importAll mode any ideas?

    opened by Stanzilla 11
  • Correctly escape URLs.

    Correctly escape URLs.

    As per the title, the bot does not currently correctly handle spaces in filenames and/or folder names. I am unable to demonstrate this as I encountered the bug in a private repository.

    I would be willing to lend a hand in fixing this given guidance on where to look in the codebase.

    Thank you in advance.

    opened by PurpleMyst 6
  • Not able to update label field

    Not able to update label field

    I keep getting an error saying it only supports 'boolean' types... looking at the index.js:

    exports.argumentContext = {
        keywords: inputParser.getInput('keywords', { type: 'array', default: ['TODO'] }),
        bodyKeywords: inputParser.getInput('bodyKeywords', { type: 'array', default: [] }),
        caseSensitive: inputParser.getInput('label', { type: "boolean", default: true }),
        titleSimilarity: inputParser.getInput("taskSystem", {
            type: "number",
            disableable: true,
            default: 80
        }),
        label: inputParser.getInput('label', { type: "array", disableable: true, default: true }),
        blobLines: inputParser.getInput('blobLines', { type: "number", default: 5, disableable: true }),
        autoAssign: inputParser.getInput('autoAssign', {
            type: "array",
            disableable: true,
            default: true
        }),
        excludePattern: inputParser.getInput('excludePattern', { type: 'string' }),
        taskSystem: inputParser.getInput("taskSystem", { type: "string", default: "GitHub" }),
        importAll: (_c = (_b = (_a = github === null || github === void 0 ? void 0 : github.context) === null || _a === void 0 ? void 0 : _a.payload) === null || _b === void 0 ? void 0 : _b.inputs) === null || _c === void 0 ? void 0 : _c.importAll,
        reopenClosed: inputParser.getInput("reopenClosed", { type: "boolean", default: true })
    };
    

    Do I read that correctly that: caseSensitive: inputParser.getInput('label', { type: "boolean", default: true }), is colliding? (typo?)

    opened by terafin 2
  • Add to regex :)

    Add to regex :)

    https://github.com/DerJuulsn/todo-issue/blob/be068105975e8d131602b3aeb3a03d6a257657e8/src/Todo.ts#L61-L66


    This issue was generated by todo-issue based on a TODO comment in be068105975e8d131602b3aeb3a03d6a257657e8.
    todo :spiral_notepad: 
    opened by github-actions[bot] 1
  • Send comment before close?

    Send comment before close?

    https://github.com/DerJuulsn/todo-issue/blob/9337b5b319c249cc66290a40d0005c5d7634204f/src/TodoHandler.ts#L67-L72


    This issue was generated by todo-issue based on a TODO comment in 9337b5b319c249cc66290a40d0005c5d7634204f. It's been assigned to @DerJuulsn because they committed the code.
    todo :spiral_notepad: 
    opened by github-actions[bot] 1
  • Merge methods getDiffFile and getDiff

    Merge methods getDiffFile and getDiff

    https://github.com/DerJuulsn/todo-issue/blob/be068105975e8d131602b3aeb3a03d6a257657e8/src/GitHubContext.ts#L60-L65


    This issue was generated by todo-issue based on a TODO comment in be068105975e8d131602b3aeb3a03d6a257657e8.
    todo :spiral_notepad: 
    opened by github-actions[bot] 0
  • Extend config for issue merge?

    Extend config for issue merge?

    wenn das to_do einen sehr ähnlichen Titel hat, aber evtl nicht in der selben Datei steht kann er entweder zusammen gefasst werden (wenn der Titel länger als z.B. 15 zeichen ist?) oder der Titel kürzer ist und somit nicht aussagekräftig genug ist um es in dasselbe Issue zu stecken fürs erste gehen wir mal davon aus so oft wie möglich zu mergen


    https://github.com/DerJuulsn/todo-issue/blob/be068105975e8d131602b3aeb3a03d6a257657e8/src/helpers.ts#L48-L53


    This issue was generated by todo-issue based on a TODO comment in be068105975e8d131602b3aeb3a03d6a257657e8.
    todo :spiral_notepad: 
    opened by github-actions[bot] 0
Releases(v1.1.4)
Owner
Julian
Julian
🤖 An action that fetches the list of malicious domains on Discord in different providers and creates/updates a JSON file with them from time to time.

Discord Guardian Action ??  This action fetches the list of malicious domains on Discord in different providers and creates/updates a JSON file with t

Dalton Menezes 7 Nov 30, 2022
A GitHub action to submit your dependency graph from your Mill build to GitHub.

Mill Dependency Submission A GitHub action to submit your dependency graph from your Mill build to GitHub via their Dependency Submission API. The mai

Chris Kipp 6 Dec 15, 2022
Add a table of contents to the sidebar of your GitHub issues and pull requests.

github-sidebar-jump-extension Getting started ?? Build locally Checkout the repository to your local machine Run npm install to install all required d

Jason Barry 11 Sep 7, 2022
Dokka plugin to render Mermaid graphics, from your code comments to your Dokka documentation.

Html Mermaid Dokka plugin Mermaid-Dokka MermaidJS 0.2.2 8.14.0 0.3.0 9.0.0 Step 1: install dependencies { dokkaPlugin("com.glureau:html-mermaid-dokk

Grégory Lureau 23 Sep 16, 2022
Automate adding issues and pull requests to GitHub projects (beta)

actions/add-to-project Use this action to automatically add the current issue or pull request to a GitHub project. Note that this is for GitHub projec

GitHub Actions 293 Jan 3, 2023
(WIP) A GitHub action that backs up your repo's source code to IPFS.

repo-backup-ipfs A GitHub Action that backs up your repository's source code to IPFS. How to use Create a workflow file in your repository at .github/

Dhaiwat Pandya 4 Oct 9, 2022
(WIP) A GitHub action that backs up your repo's source code to Arweave.

repo-backup-arweave A GitHub action that backs up your repo's source code to Arweave. How to use Create a workflow file in your repository at .github/

Dhaiwat Pandya 9 Sep 11, 2022
Fixes code dependency issues 🤼‍♀️

Codependence ??‍♀️ Codependence is a JavaScript utility CLI or node tool for checking specified dependencies in a project to ensure dependencies are u

Jeff Wainwright 10 Dec 15, 2022
GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (istanbul)

GitHub Action: Report NYC coverage GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (ista

Sid 16 Nov 23, 2022
A self-hosted Thumbnail generator/finder which creates thumbnails based on folder names and google search results.

Thumba A self hosted Thumbnail generator/finder which creates thumbnails based on folder names and google search results. Description This project use

Norbert Takács 20 Dec 15, 2022
GitHub action code for VMware Image Builder (VIB).

VMware Image Builder Overview This GitHub Action allows to interact with the VMware Image Builder service from VMware, a.k.a. VIB. VIB is a SaaS servi

VMware  Labs 10 Dec 22, 2022
Copy/paste detecting GitHub Action for programming source code (jscpd)

dry-code Copy/paste detecting GitHub Action for programming source code with jscpd Action inputs Action input Description Default Value Required optio

null 5 Dec 14, 2022
GitHub Action that checks code and docs for offensive / exclusive terms and provides warnings.

Inclusiveness Analyzer Make your code inclusive! The Inclusiveness Analyzer is a GitHub action that checks your repository for offensive / exclusive t

Microsoft 21 Dec 1, 2022
Github action to collect metrics (CPU, memory, I/O, etc ...) from your workflows to help you debug and optimize your CI/CD pipeline

workflow-telemetry-action A GitHub Action to track and monitor the resource metrics of your GitHub Action workflow runs. If the run is triggered via a

Thundra 32 Dec 30, 2022
This plugin allows you to track the progress of Atlassian Jira issues from your Obsidian notes.

Obsidian jira-issue This plugin allows you to track the progress of Atlassian Jira issues from your Obsidian notes. Usage Configuration Use the plugin

Marco Lucarella 74 Dec 30, 2022
A utility for cloning all your repos, including issues, discussions, stargazers and more!

github-takeout A utility for cloning all your repos, including issues, discussions, stargazers and more! The tool gives you the ability to download a

Lukas Bach 5 Oct 26, 2022
A simple code that creates a string of random characters displayed in an html object, all saving in a json file.

I'm 17 Years Old Developer / Lead Developer. ?? I'm wroking on AdrenalinaRP, GrandRDM. ?? I’m currently learning JavaScript. ?? I’m looking to collabo

OFFVIXEN 2 Nov 17, 2022
Creates code review tasks from given member list to Clickup.

What is codeReview and what it does? What is codeReivewer: codeReviewer is a helper tool that helps me to create code review tasks inside of ClickUp a

Burak 4 Jul 5, 2022
A GitHub Action to cache your workload to a Google Cloud Storage bucket.

Google Cloud Storage Cache Action GitHub already provides an awesome action to cache your workload to Azure's servers hosted in United States. However

MansaGroup 9 Dec 15, 2022