Skip to content

Link issue

Actions
Link a pull-request to an external issue getting id from branch name, PR title or commit message
v1.2
Latest
By ov7a
Star (2)

build status build status

Link issue Github Action

This Github action can be used to automatically link PRs to issues from external trackers (JIRA, Redmine, etc) by issue id.

Action inputs

The possible inputs for this action are:

Parameter Required? Default Description
sources no branch, title, commit A list of locations where issue id should be taken from. Possible values: branch, title, commit.
issue-pattern yes A regex to match and extract issue id. For example, use [A-Z][A-Z]+-\d+ for JIRA issues or #(\d+) for Redmine issues.
link-template yes Link template to paste id or its part into. You should use regex groups here. Example: https://example.com/browse/issues/$0
link-name-template no $0 Template for link name
link-preamble no Related issues Text before list of links
link-location no end Location to paste link to. Possible values: start, end.
token no GITHUB_TOKEN GitHub token

Examples

Link JIRA issue from PR title, append to the end of message:

name: Link issue

on:
  pull_request:
    types: [opened, edited]

jobs:
  link-jira-issue:
    runs-on: ubuntu-latest
    steps:
      - name: Link Jira Issue
        uses: ov7a/link-issue-action@v1
        with:
          sources: title
          issue-pattern: '[A-Z][A-Z]+-\d+'
          link-template: 'https://somedomain.atlassian.net/browse/$0'

Link Redmine issue from commits messages and branch name, append to the start of message:

name: Link issue

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  link-redmine-issue:
    runs-on: ubuntu-latest
    steps:
      - name: Link Redmine Issue
        uses: ov7a/link-issue-action@v1
        with:
          sources: |
            branch
            commit
          issue-pattern: '#(\d+)'
          link-template: 'https://somedomain.com/issues/$1'
          link-location: start

Building

npm run all

Link issue is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Link a pull-request to an external issue getting id from branch name, PR title or commit message
v1.2
Latest
By ov7a

Link issue is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.