DEV Community

Cover image for Jira Link Auto Commenter
Bimochan Shrestha
Bimochan Shrestha

Posted on

3 2

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

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

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

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay