Tired of manually managing autolinks for your project management tool issues in your GitHub repo? I have a solution for you!
This GitHub Action automatically synchronizes project management tool projects with GitHub repository autolinks.
This ensures that issue references (e.g., PROJECT-123
) in issues, pull requests, and commits automatically link to the corresponding tickets.
Currently supported tools:
- ✅ JIRA
- 🔄 Other tools (planned for future releases)
- Fetches all JIRA projects from your instance
- Creates autolinks for each project key (e.g.,
PROJECT-
→https://your-jira.com/browse/PROJECT-123
) - Updates existing autolinks if JIRA URL changes
- Removes obsolete JIRA autolinks when projects are deleted
- Preserves non-JIRA autolinks
name: Sync JIRA Autolinks
on:
schedule:
- cron: '0 2 * * *' # Run daily at 2 AM
workflow_dispatch: # Allow manual trigger
jobs:
sync-autolinks:
runs-on: ubuntu-latest
steps:
- uses: IlyaGulya/action-sync-autolinks@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
jira-url: ${{ vars.JIRA_URL }}
jira-username: ${{ vars.JIRA_USERNAME }}
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
- uses: IlyaGulya/action-sync-autolinks@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
jira-url: ${{ secrets.JIRA_URL }}
jira-username: ${{ vars.JIRA_USERNAME }}
jira-api-token: ${{ vars.JIRA_API_TOKEN }}
repository: 'owner/repo' # Optional: specify different repo
dry-run: 'true' # Optional: test changes without applying them
Input | Description | Required | Default |
---|---|---|---|
github-token |
GitHub token for API access | Yes | ${{ github.token }} |
jira-url |
JIRA instance URL (e.g., https://company.atlassian.net ) |
Yes | - |
jira-username |
JIRA username/email | Yes | - |
jira-api-token |
JIRA API token | Yes | - |
repository |
Repository in format owner/repo |
No | ${{ github.repository }} |
dry-run |
Run in dry-run mode (plan only, no changes) | No | false |
Output | Description |
---|---|
projects-synced |
Number of JIRA projects processed |
autolinks-processed |
Number of autolink operations performed (create/update/delete) |
- Go to your JIRA instance
- Navigate to Account Settings → Security → API tokens
- Create a new API token
- Save the token securely
Add these secrets to your repository:
JIRA_URL
: Your JIRA instance URL (e.g.,https://company.atlassian.net
)JIRA_USERNAME
: Your JIRA username or emailJIRA_API_TOKEN
: The API token created above
The action requires:
- Repository administration permissions (to manage autolinks)
- JIRA project browse permissions (to list projects)
- Fetch JIRA Projects: Uses JIRA REST API to get all accessible projects
- Get Existing Autolinks: Retrieves current repository autolinks via GitHub API
- Sync Process:
- Creates new autolinks for JIRA projects that don't have them
- Updates existing autolinks if the JIRA URL changed
- Removes obsolete JIRA autolinks (preserves non-JIRA ones)
- Result: JIRA references like
PROJ-123
automatically link tohttps://your-jira.com/browse/PROJ-123
After running, references in issues and PRs will automatically link:
MYPROJ-123
→ Links tohttps://company.atlassian.net/browse/MYPROJ-123
TASK-456
→ Links tohttps://company.atlassian.net/browse/TASK-456
- Ensure the GitHub token has repository admin permissions
- Verify JIRA credentials have project browse access
- Check JIRA URL format (should include protocol:
https://
) - Verify API token and username are correct
- Ensure user has access to JIRA projects
- Repository admin permissions required for autolink management
- Check if autolink limits are reached (GitHub has limits per repository)
MIT