Connect GitHub Actions to Test Companion
Analyze a failed GitHub Actions run in your IDE. Paste the run URL into Test Companion to get the root cause and a suggested fix.
When a GitHub Actions run fails, you read the CI log in the browser, then switch to your IDE to find the cause. Test Companion removes that switch. Paste the failed run URL into the chat. Test Companion reads the CI logs and the test artifacts from the run. It compares them with the code in your workspace, then explains why the test failed.
You do not set up anything on the BrowserStack Integrations page. Test Companion signs in to GitHub through the GitHub CLI on your machine.
Prerequisites
Ensure you have the following:
- Test Companion is installed in your IDE and you are signed in.
- The GitHub CLI is installed. Run
gh --versionto check. To install it, navigate to cli.github.com, or runbrew install ghon macOS. - You are signed in to the GitHub CLI. Run
gh auth statusto check. To sign in, rungh auth loginand follow the prompts. - Your GitHub account has read access to the repository. Private repositories need this access before Test Companion can read the run.
- The repository that the failed run belongs to is open in your IDE.
Check out the branch that CI ran
Test Companion compares the CI failure against the files in your workspace. Check out the branch that the failed run used before you paste the URL.
On a matching branch, Test Companion writes the fix to your files. On a different branch, it still explains the failure. The fix then arrives as code for you to copy, because the file is not in your workspace to edit.
Analyze a failed run
To get the root cause of a failed run, follow these steps:
- Navigate to the failed run in GitHub, then open the job that failed.
-
Copy the complete URL from the browser address bar. A job URL looks like this:
https://github.com/<org>/<repo>/actions/runs/<run-id>/job/<job-id> - Open the Test Companion panel in your IDE.
- Paste the URL into the chat box. On a new line, type what you want Test Companion to do, for example,
analyze the failuresorfix the failures. - Press Enter, or click Send message (➤).
Paste the whole URL. When a segment is missing, Test Companion tells you in the chat that the URL is incomplete. Copy it again from the address bar.
You can ask Test Companion to analyze the failures or to fix them in your workspace. Test Companion works from the evidence it fetched, so it does not run or restart anything on your CI machine.
A run with more than one failing test is analyzed as one task. The CI Failure Analysis block lists each failing test with its own error output, and the summary at the end covers every failure.

What Test Companion reads from the run
Test Companion confirms that gh is installed and signed in, then fetches the failure evidence from the run. The chat first shows a summary line with the number of failed jobs and failed tests. A CI Failure Analysis block follows it.
The block reports the following details:
- The workflow name and the run number.
- The run title.
- The branch and the commit that CI used.
- The conclusion of the run, such as
failure. - Each failing test, with the error output from the CI log.
Review the fix
Test Companion ends the task with Task Completed and a short summary. The summary names the failing test and the line that failed. It quotes the evidence from the CI log, then shows the change as a before and after code block.

What happens next depends on your branch:
- Your branch matches the CI branch: Test Companion saves a checkpoint of your workspace, then writes the change to your files. Click Changes to review the edits, or Restore to undo them. Run the test again to confirm it passes.
- Your branch does not match: Test Companion names the branch that holds the file. The fix appears as before and after code. Check out that branch, apply the change, then run the test.
Confirm the fix in CI
Test Companion fixes the failure in your local files. It does not start a run on your CI machine.
To confirm the fix in CI, follow these steps:
- Run the fixed test locally and confirm it passes.
- Commit the change and push it to your repository.
- Wait for the workflow to run on the push, then check that the run passes.
When the cause is not in your code
Not every CI failure is a bug in your test. Test Companion grounds its explanation in the CI log. When the evidence points to the environment or the infrastructure rather than your test code, Test Companion says so in the summary. It does not change your test.
A missing environment variable in the CI job is one example. Fix the cause in your workflow file, then run the job again.
Next steps
- Fix failed tests: Fix failures from the Failure Analysis panel, an imported Allure or JUnit report, the Automate dashboard, or the chat.
- Connect Jenkins to Test Companion: Analyze a failed Jenkins build the same way.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!