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@v0 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 in comments/issues. |
|
| The username that triggers a Junie action when assigned. | - |
| The GitHub label that triggers a Junie action when applied to an issue. |
|
Branch management
Input | Description | Default |
|---|---|---|
| The base branch for creating new branches from. |
|
| Determines whether Junie should create a new branch when proposing changes for a pull request, or push commits directly to the existing branch of that PR. |
|
Junie configuration
Input | Description | Default |
|---|---|---|
| User-defined instructions for Junie. | - |
| The LLM to use for Junie's primary agent. For the available options, see Model selection. | - |
| The Junie CLI version to install. | - |
| The directory used by Junie CLI for storing its working files, caches, and session artifacts. |
|
| The name of a file with Junie's guidelines (e.g. |
|
| A comma-separated list of MCP servers to enable. | - |
Advanced features
Input | Description | Default |
|---|---|---|
| Enables Junie to automatically detect and resolve merge conflicts in pull requests. |
|
| Runs Junie in silent mode without repository modifications (committing code, creating branches or pull requests) or user-facing feedback (posting PR/issue or inline comments). |
|
| Reuses and updates a single comment for all Junie runs instead of creating a new comment for every execution. |
|
| Uses 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. |
| Specifies whether Junie's execution was skipped (due to no trigger matched or no |
| 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 Junie action. |
Example usage of output parameters in the workflow:
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: