GitHub Actions
You want every pull request to get a ticket in InsightJet, and, if you choose, a test whose result lands on the pull request, without writing the calls yourself. The InsightJet/run-tests GitHub Action does this in one workflow step. It never fails your build because of InsightJet.
For the same flow through the InsightJet GitHub App, or by calling the two addresses yourself, see GitHub pull request tests.
Set up
Section titled “Set up”- Make the key the Action uses. It is an assistant (MCP) key, one that starts with
mcp_, not an API key (ijk_), even though the Action’s input is namedapi-key. In InsightJet, open Settings → Integrations → AI assistants (MCP), enter a name and click Make key. Copy the key at once; it is shown only once. See Keys. An API key is refused by the Action’s addresses. - Save it as a repository secret called
INSIGHTJET_API_KEY: in GitHub, Settings → Secrets and variables → Actions → New repository secret. - Add a rule in InsightJet that watches the repository: Settings → Automations, then add a rule for your repository and branch with the event A pull request opens. The rule needs the InsightJet GitHub App installed on the repository’s account: connect it under Settings → Integrations → GitHub → Pull request tickets. The key belongs to the team that was active when you made it, and the rule must belong to that same team. Without a rule, the step prints a notice and does nothing.
A key may start 20 tests in any 24 hours when start is true (a test here is one ticket run). The limit is shared with the InsightJet MCP server, so a key used both ways counts both. When it is reached, the step prints when the key can start again, no test runs, and the build carries on.
The workflow
Section titled “The workflow”Add this file as .github/workflows/insightjet.yml:
name: InsightJeton: pull_request: types: [opened, reopened]
permissions: contents: read pull-requests: write
jobs: insightjet: runs-on: ubuntu-latest steps: # "@v1" follows our updates. To pin one exact version, use a full commit SHA instead: InsightJet/run-tests@<full commit SHA> - uses: InsightJet/run-tests@v1 with: api-key: ${{ secrets.INSIGHTJET_API_KEY }} start: trueWith start: true it makes the ticket and starts a test. Leave start out and it only makes the ticket; a person starts a test from the ticket in InsightJet.
Pin the version
Section titled “Pin the version”@v1 moves whenever a new version is published. To make the code you reviewed the code that runs, pin the Action to a full commit SHA, uses: InsightJet/run-tests@<full commit SHA>, and update the SHA yourself when you want a newer version.
Runners
Section titled “Runners”GitHub-hosted runners have everything the step needs. On a self-hosted runner you need bash, jq, and curl 7.55 or newer.
Options
Section titled “Options”| Option | Default | What it does |
|---|---|---|
api-key | required | The InsightJet key, an assistant (MCP) key (see Keys). Pass it from a secret. |
url | https://insightjet.ai | The address of InsightJet: a plain https:// host name, with an optional port and path. No user name, query, spaces, brackets or braces; such an address is refused and nothing is sent. Your API key is sent to this address, so if the host is not insightjet.ai, or the port is not 443, the step prints a notice naming the host and port. |
start | false | false: only make the ticket. true: also start a test on every pull request. |
wait | true | With start: true: wait for the result. With false, the step carries on at once and the result stays on the ticket. |
timeout-minutes | 15 | The longest the wait may take, from 1 to 360, counting the time of each request. When time runs out the step carries on and the verdict is could_not_check. |
comment | true | Post the result on the pull request. Needs pull-requests: write. |
fail-on | never | never: the step does not fail the build. failed: it fails the build only when the test result is failed. |
What it costs. Each test the Action starts uses agent-hours from your plan. With start: false (the default) the Action makes tickets only and starts no test, so no test uses agent-hours.
What the job shows
Section titled “What the job shows”- One ticket for the pull request, made from its title, description and changed files. Running again on the same pull request, for example after it is reopened, updates that ticket and does not make a second one.
- With
start: true, a test on that ticket, and the step waits for the result. - One comment on the pull request with the result, updated in place on later runs. It is not posted when the InsightJet GitHub App already keeps a comment on that pull request.
- A short summary on the workflow run page.
The step has three outputs:
| Output | Value |
|---|---|
ticket-link | The ticket’s page in InsightJet. Left empty if InsightJet gives a link that does not start with your url. |
verdict | passed, failed or could_not_check. Empty when no result was asked for. |
started | true or false. |
Use ticket-link in a later step, for example ${{ steps.insightjet.outputs.ticket-link }} after giving the step id: insightjet.
The verdicts
Section titled “The verdicts”These are the only three values the Action sets:
passed: the test passed.failed: the test failed.could_not_check: no result was reached, for example when time ran out, the key was wrong or InsightJet could not be reached. It says nothing about your app.
The Results tab in InsightJet uses a longer list of verdict words for each goal; the Action reduces a run to these three.
What it does not do
Section titled “What it does not do”- It does not test the pull request’s own code.
- It does not start a test unless you set
start: true. - It only makes tickets for pull requests from people the repository knows: owners, members and collaborators. Others are skipped.
InsightJet stores the ticket it makes: it is built from the pull request’s title, its description and the paths of its changed files, and your team can see it in InsightJet. The Action itself keeps nothing.
What leaves your repository
Section titled “What leaves your repository”Sent to InsightJet: the repository name, the pull request number, its title, the first 20,000 characters of its description, the author’s login and their relation to the repository, the target branch, and the paths of the first 100 changed files (no file contents). Your GitHub token stays on the runner; it is used only to read those paths and to post the comment. The API key is masked in the logs, and the Action never prints the description.
If your repository is public, the comment is public too: anyone who can see the pull request can read it, including the address that was tested and a link to the full result. Use comment: false if that is not what you want.
Troubleshooting
Section titled “Troubleshooting”The step printed a notice and did nothing, or the verdict is could_not_check. InsightJet could not be reached or said no: a wrong key (an API key ijk_ is the wrong kind; the Action needs an assistant key), a lapsed plan, a missing rule, a pull request that is too large, too many requests, an outage or no network. The step prints a plain notice and carries on; the build does not fail for any of these. The only way the step fails your build is fail-on: failed with a result of failed.
No rule. Add the rule from step 3 in Set up. Check that its repository and branch match, and that it belongs to the same team as the key.
Pull requests from forks. GitHub does not give secrets to workflows that run for a pull request from a fork, so the key is empty there. The step prints a notice and does nothing. Do not switch to pull_request_target to make forks work: the Action refuses to run on it, because that event gives secrets and write access to code from forks, and this step reads text a stranger wrote.
No comment appeared. Check that the workflow has pull-requests: write, that comment is not false, and that the InsightJet GitHub App is not already keeping a comment on the pull request.
The daily limit. Each key may start 20 tests in any 24 hours, shared with the MCP server. The step prints when the key can start again.
See also
Section titled “See also”- GitHub pull request tests: the GitHub App’s comment with a tick-box, and the two addresses the Action calls.
- MCP tool reference: the tools that share the key’s daily limit.
- Tickets and ticket runs: what a test on a ticket shows.