Skip to content

jolution/todo-nukem-pr-ticket-link

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TODO NUKEM - PR Ticket Link Action

Automatically adds ticket links to Pull Request descriptions based on branch names.

Quick Setup

Create .github/workflows/todo-nukem-pr-ticket-link.yml in your project:

name: TODO NUKEM - Add Ticket Link to PR

on:
  pull_request:
    types: [opened]

jobs:
  add-ticket-link:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      contents: read
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Add ticket link to PR
        uses: jolution/todo-nukem-pr-ticket-link@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

Configuration

Add ticketBaseUrl to your package.json:

{
  "todonukem": {
    "ticketBaseUrl": "https://jira.example.com/browse/"
  }
}

Or create a .todonukem.json file (overrides package.json):

{
  "ticketBaseUrl": "https://your-company.atlassian.net/browse/"
}

Optional: Ticket Prefix

Add a ticketPrefix to display a system-specific prefix in the ticket reference (prefix is only used for display, not in the URL):

{
  "ticketBaseUrl": "https://dev.azure.com/myorg/myproject/_workitems/edit/",
  "ticketPrefix": "AB#"
}

Examples:

  • Azure DevOps with auto-linking (Learn more):

    - name: Add ticket link to PR
      uses: jolution/todo-nukem-pr-ticket-link@v1
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        linkStyle: plaintext
    { "ticketPrefix": "AB#" }

    Branch: feature/AB-1234-my-feature → Shows: [ 🎫 AB#1234 ] (auto-linked by Azure DevOps)

  • Azure DevOps with explicit link:

    {
      "ticketBaseUrl": "https://dev.azure.com/myorg/myproject/_workitems/edit/",
      "ticketPrefix": "AB#"
    }

    Branch: feature/AB-1234-my-feature → Shows: [ 🎫 [AB#1234](...) ]

  • JIRA, Linear, or others (default, no prefix):

    {
      "ticketBaseUrl": "https://jira.example.com/browse/"
    }

    Branch: feature/PROJ-1234-my-feature → Shows: [ 🎫 [1234](...) ]

Branch Naming

Your branch names must contain a ticket ID:

  • feature/PROJ-123
  • fix/TICKET-456
  • PROJ-789-refactor
  • feature/my-feature (no ticket ID)

Result

Appends a footer to the PR description. The exact format depends on linkStyle:

markdown (default)

---

<!-- TODO NUKEM PR Ticket Link -->

[ 🎫 [PROJ-123](https://jira.example.com/browse/PROJ-123) ]

_via [TODO NUKEM](https://github.com/jolution/todo-nukem)_

plaintext (e.g. for Azure DevOps auto-linking)

---

<!-- TODO NUKEM PR Ticket Link -->

[ 🎫 AB#123 ]

_via [TODO NUKEM](https://github.com/jolution/todo-nukem)_

The HTML comment acts as a marker to prevent duplicate entries on subsequent runs.

Inputs

Name Description Required Default
github-token GitHub token for API access Yes ${{ github.token }}
hidePromotion Hide the 'via TODO NUKEM' promotion link No false
linkStyle Format of the ticket reference: markdown (Markdown hyperlink) or plaintext (plain text, e.g. for Azure DevOps auto-linking) No markdown

Related

About

Automatically adds ticket links to Pull Request descriptions based on branch names

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages