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

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more