I’m setting up a Rovo Dev code-review agent for pull requests in Bitbucket Pipelines, but the pipeline fails with:
Error: Missing required environment variable(s): USER_API_TOKEN, USER_EMAIL
Rovodev requires USER_API_TOKEN and USER_EMAIL to start.
This happens with both auth: system and auth: user.
My bitbucket-pipelines.yml:
image: node:22
definitions:
agents:
code-review-agent:
prompt: "!.rovodev/prompts/pr-code-reviewer/prompt.md"
pipelines:
# Pull request pipeline (for code review)
pull-requests:
'**':
- step:
name: AI Code Review
size: 2x
auth:
user:
scopes:
- read:repository:bitbucket
- read:pullrequest:bitbucket
- write:pullrequest:bitbucket
script:
- agent: code-review-agent
What I’ve tried:
-
Using
auth: userwithread:repository,read:pullrequest, andwrite:pullrequestscopes -
Using
auth: systeminstead ofauth: user -
Ensuring the prompt file exists at
!.rovodev/prompts/pr-code-reviewer/prompt.md -
Running the pipeline on a PR branch (
feat/add-pr-code-review-agen)
Error I’m getting:
The pipeline clones the repo successfully, but when it reaches the agent step, it fails with:
+ "${AGENT_INSTALL_PATH}/run-agent.sh" "code-review-agent" "!.rovodev/prompts/pr-code-reviewer/prompt.md"
Running rovodev agent from: /opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/agent
Installer Version: local:80259.1786074296.monorepo
Event Mode: TRANSFORMED
Error: Missing required environment variable(s): USER_API_TOKEN, USER_EMAIL
Rovodev requires USER_API_TOKEN and USER_EMAIL to start.