A GitHub Action that automatically updates Pull Request titles and descriptions with Jira issue information, extracted from branch names.
- Extracts Jira issue IDs from branch names using the pattern
^[A-Za-z]+-[0-9]+
(e.g., PROJECT-123) - Prepends the Jira issue ID to the PR title
- Adds a link to the Jira issue in the PR description
- Preserves any existing PR description content
When creating a PR from a branch named ABC-123-feature-description
:
- Title will be updated to:
ABC-123: Your PR Title
- Body will be updated to include:
[JIRA Link: ABC-123](https://your-org.atlassian.net/browse/ABC-123) --- Your original PR description (if any)
Create a file in your repository at .github/workflows/jira-pr-updater.yml
:
name: Jira PR Updater
on:
pull_request:
types: [opened, reopened, edited]
jobs:
update-pr:
runs-on: ubuntu-latest
steps:
- name: Update PR with Jira Info
uses: srajasimman/jira-pr-updater@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
jira-base-url: 'https://your-org.atlassian.net'
Name | Description | Required | Default |
---|---|---|---|
github-token |
GitHub token used to update PR | Yes | ${{ github.token }} |
jira-base-url |
Base URL for your Jira instance (e.g., https://your-org.atlassian.net) | Yes | N/A |
# Install dependencies
npm install
# Build the action
npm run build
To test changes locally:
- Push your changes to a branch in your fork
- Create a workflow that uses your forked action branch
- Create a PR to trigger the workflow
This project is licensed under the MIT License.