Junie GitHub Action
Junie GitHub Action integrates Junie CLI into your GitHub workflows. It also allows you to trigger Junie to run code reviews, fix bugs, or implement new features right from GitHub issues or PR comments.
The action executes entirely on your GitHub runners, so your code always stays on your infrastructure.
Key features
Turning issues into fixes: Junie creates pull requests with code changes or fixes from issue descriptions, PR reviews, or comments.
Agent-enhanced CI/CD automation: Fix CI build failures, automatically resolve merge conflicts, or solve your specific CI/CD goals with Junie CLI.
Task- or workflow-specific prompts: Tag Junie and provide instructions in GitHub issues, comments, or PR reviews, or just pre-define your prompt to run every time when the workflow is triggered.
Flexible triggers: Trigger Junie CLI on specific events in your CI/CD pipeline, via mentions, assignees, or labels.
Silent mode: Run Junie CLI in silent mode without writing comments or committing changes as an output.
MCP extensibility: Connect to pre-configured MCP servers from GitHub Actions workflows.
Agent guidelines for GitHub: Define GitHub-specific guidelines that would override the default guideline file. This can be useful if you are using Junie both in your JetBrains IDE or terminal and in GitHub Actions.
Setup
Get started in minutes with your API key and preconfigured templates.
To set up Junie GitHub Actions in your repository:
Add
JUNIE_API_KEYto the repository's secrets in Settings → Secrets and variables → Actions. To generate the key, go to junie.jetbrains.com/cli.Add one of the preconfigured workflow files to your repository's
.github/workflows/.To start with, you can copy and paste the following
junie.yamltemplate:name: Junie on: issue_comment: types: [created] pull_request_review_comment: types: [created] issues: types: [opened, assigned] pull_request_review: types: [submitted] jobs: junie: if: | (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@junie-agent')) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@junie-agent')) || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@junie-agent')) || (github.event_name == 'issues' && (contains(github.event.issue.body, '@junie-agent') || contains(github.event.issue.title, '@junie-agent'))) runs-on: ubuntu-latest permissions: contents: write pull-requests: write issues: write steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 - name: Run Junie id: junie uses: JetBrains/junie-github-action@v1 with: junie_api_key: ${{ secrets.JUNIE_API_KEY }}This workflow will run Junie CLI whenever the user tags @junie-agent in an issue or PR comment.
A repository can have multiple workflow files with the Junie GitHub Actions in it, each performing a different set of tasks.
See the cookbook for examples of workflow templates to help you get up and running with different scenarios. You can adapt the templates to configure triggers, permissions, branches, or output, adjust the prompt, or further customize the action with parameters.
Parameter reference
Input Parameters
Trigger configuration
Input | Description | Default |
|---|---|---|
| The phrase to activate Junie CLI in comments/issues. |
|
| Username that triggers when assigned. | - |
| Label that triggers the action. |
|
Branch management
Input | Description | Default |
|---|---|---|
| The base branch for creating new branches from. |
|
| Create a new branch for PR contributors. |
|
Junie configuration
Input | Description | Default |
|---|---|---|
| Custom instructions for Junie. | - |
| Junie CLI version to install. |
|
| Working directory for Junie files. |
|
| Filename of the guidelines file (should be in |
|
| MCP servers to enable (comma-separated). | - |
Advanced features
Input | Description | Default |
|---|---|---|
| Enable automatic conflict detection (not needed for manual |
|
| Run Junie without comments, branch creation, or commits - only prepare data and output results. |
|
| Update a single comment for all runs instead of creating new comments each time. |
|
| Use the new structured prompt format with XML tags for better organization. |
|
Authentication
Input | Description | Required |
|---|---|---|
| JetBrains Junie API key. | Yes |
| Custom GitHub token (optional). | No |
Output parameters
Output | Description |
|---|---|
| Name of the working branch created by Junie. |
| Whether Junie execution was skipped (no trigger matched or no write permissions). |
| SHA of the commit created by Junie (if any). |
| URL of the pull request created by Junie (if any). |
| Title of the task completion from Junie. |
| Summary of the changes made by Junie. |
| The GitHub token used by the action. |
Example usage:
MCP servers
The available pre-configured MCP servers are:
MCP server | Description |
|---|---|
| Analyzes failed GitHub Actions checks. |
| Creates inline code review comments with GitHub suggestions on PRs (enabled automatically for PRs). |
Example configuration: