DEV Community

Cover image for Jira Link Auto Commenter
Bimochan Shrestha
Bimochan Shrestha

Posted on

Jira Link Auto Commenter

Migrating from bitbucket to Github made me lack only one feature. The link that navigates to its related Jira ticket from pull request.

This is why I created this tool for my project.
This Github action auto comments in pull request with Jira link to it. This tool is helpful for devs who use consistent PR summary like Ticket-1234: This is PR summary.
It grabs the ticket number using regex and comments on the PR by making a JIRA link. If it can't find the ticket number, it will fail silently and won't fail the whole workflow.

How to use:

Create a workflow file in root of your project.
.github/workflows/main.yml

Input:

  • custom-comment(optional): If you want to add your own comments before Jira link. Default is Thank you for your contributions. Jira link:
  • jira-project-url: you can figure our this URL by going to any of your JIRA ticket in new tab and checking the URI box.
  • GITHUB_TOKEN: is auto generated
on: pull_request

jobs:
  example_comment_pr:
    runs-on: ubuntu-latest
    name: Auto jira link commenter
    steps:
      - name: Checkout
        uses: actions/checkout@v1

      - name: Comment PR
        uses: sbimochan/jira-link-commenter@v2.4

        with:
          jira-project-url: https://jira.atlassian.net/browse
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          custom-comment: 'Thank you for your contribution!!! :confetti_ball:'
Enter fullscreen mode Exit fullscreen mode

Hope you will find it useful for your project.

Links:

Marketplace
Github Repo

Top comments (0)