DEV Community

Jesse Piaścik
Jesse Piaścik

Posted on

3 2

How I automate my changelog with imdone!

I work full time as an advising consultant and software engineer, so I really need to automate a lot my work on imdone. For starters, I use imdone to plan and manage releases of imdone.

Being the first user of an imdone release allows me to try out new functionality to automate my workflow. In imdone 1.26, I introduced the ability to add .imdone/actions/card.js and .imdone/actions/board.js modules. This allows you to add board actions to the main menu in imdone.

board actions

This board action copies each card in the READY list as a markdown list, which you can paste into your changelog.

To add this menu option create a .imdone/actions/board.js file in your project and add the following.

module.exports = function () {
  const project = this.project
  return [
    {
      title: 'Copy changelog',
      action: function () {
        const lists = project.lists.filter((list) => list.name === 'READY')
        const cards = lists[0].tasks.map((task) => {
          const contentArray = task.description.map((line) =>
            line.replace(/^/, '  ')
          )
          contentArray.unshift(
            task.text.replace(/^\#*\s*/, '').replace(/^/, '- ')
          )
          return contentArray
            .filter((line) => !/^\s*- \[x\]/.test(line.trim()))
            .join('\n')
            .replace(/<!--.*-->/gs, '')
            .split('\n')
            .filter((line) => line.trim().length > 0)
            .join('\n')
        })

        project.copyToClipboard(cards.join('\n'), 'Changelog copied')
      },
    },
  ]
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️