Check every deployed preview from CI
BetaScout checks the tasks a pull request ships on its preview, fails the build when one is broken, and comments the verdict on the pull request.
Add Scout to your pipeline as a deploy stage. Each time a preview of a pull request is deployed, Scout reads what the change is for, walks those flows on the preview like a visitor would, and answers go or no-go. A broken flow fails the job, and the pull request gets one comment with the verdict and a link to the run — the recording, the path walked and the findings.
Before you begin
- You need the Editor, Admin or Owner role.
- The preview must be reachable from the internet. A protected preview works with its bypass header — see Protected previews.
- Your host reports deployments to GitHub (Vercel and Netlify do), or your pipeline knows the preview's address.
- To check the tasks a pull request names, connect Jira, GitHub Issues or Trello to the project in Settings > Integrations. See Connect an issue tracker. Without a tracker, Scout checks what the pull request itself describes.
Each check spends tokens
Pipeline checks spend from the project's Monthly Scout budget (tokens) under Flamio Scout > Automatic checks, together with release checks, staging checks and scheduled audits. A check that would take the month past it is not started, and the job says so. A running check holds its whole budget until its tasks have their verdicts. From then on it may spend only a small reserve more to finish its report, and it holds just what it spent plus that reserve, so the next push can start while it finishes.
Set up the check
Create a CI key
Open Settings > API & MCP, click Create CI key on the CI keys card, pick the Project and give it a Name (for example the repository). Check the Monthly Scout budget (tokens): it offers 6,000 unless the project allows more already — about 24 one-task deploys a month at roughly 250 tokens each — and the line under it reads how many the number you type covers. Click Create: the budget is saved on the project, then the key is shown. Copy the key: it is shown only once.
A CI key works in one project only, and acts as the member who created it — it stops working if they leave the organization or can no longer start Scout runs. To retire a key, click Revoke on its row. A pipeline that still uses it fails with exit code 4, and the job says the key was revoked and on which day.
Add it to the repository
In the repository on GitHub, open Settings > Secrets and variables > Actions and add the key as FLAMIO_CI_KEY.
Add the workflow
Add this file to the repository. It is the same file the dialog shows when you create the key:
name: Scout
on: deployment_status
permissions:
contents: read
pull-requests: write
concurrency:
group: scout-${{ github.event.deployment.ref }}
cancel-in-progress: true
jobs:
scout:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: flamioai/scout-check@v1
with:
api-key: ${{ secrets.FLAMIO_CI_KEY }}
# A protected Vercel preview:
# headers: |
# x-vercel-protection-bypass: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
The job runs when a deployment reports success, finds the open pull request of the deployed commit, and checks its preview. It sends the deployment's environment with the check, so the check shows on that environment in Delivery. A newer push cancels the job of the previous one and stops its check.
Open a pull request
Push a branch. When its preview is deployed, the Scout job starts, and the pull request gets a comment that reads checking, then the verdict.
What Scout checks
Scout reads what the change is for, in this order:
- The task links you list in
tasks. - The tasks the pull request names on the trackers connected to the project: Jira keys in the title, the branch or the commits; GitHub issues such as
Fixes #12,owner/repo#12or a branch named12-…; tracker links in the description. - With no task found, the pull request itself — its title, description and commit messages.
With tracked-tasks: true, Scout also checks every task the project tracks — under Settings → Project → Tracked tasks — on top of the ones above: each on its own pages of the preview, against the result you wrote for it. A project that tracks no task fails the step with exit 4.
Scout turns each task into checks, walks each one from its own page, and judges every expected result on the screen it reaches. What a screen cannot show (an email, a background job) is listed under Not checked. A change with nothing on a screen — a config change, a refactor — passes with Nothing in this change shows on a screen.
The verdict
| Exit code | Means | Fails the job by default |
|---|---|---|
0 | Go: every task works, or nothing in the change shows on a screen. | No |
1 | No-go: a task is broken. | Yes |
2 | Scout could not decide or could not get in (the address led to another site, say), Flamio could not be reached, the board's tasks could not be read, or the wait ran out. | Yes |
3 | Not started: the balance or the monthly Scout budget has no room for it. | Yes |
4 | The step is set up wrong — the message says what to fix. | Always |
When a tracker does not answer as Scout reads the tasks off it, the step tries again for about 15 seconds, then exits 2; the report and the job log say which board could not be read and why. When the tracker turns Flamio's connection down, the step exits 4: reconnect the tracker under Settings → Integrations. With inconclusive left out of fail-on, the job passes, and the job log still carries the reason as a warning.
Set fail-on to choose what fails the job: broken, inconclusive (exit codes 2 and 3), high (a high or critical finding on the pages walked, of those Scout lists in the comment), comma-separated, or never. Left unset, the project's Block merges rule decides while it is On — see How Flamio runs your delivery: the step waits for the check's report and exits 1 when the rule blocks the merge, 2 when it blocks a check that could not decide. With the rule in Dry run or Off, the default is broken,inconclusive, so a check that did not finish never lets a deploy through.
A change that touches only the paths of the project's Skip docs-only changes rule is not checked: the step exits 0 and says why.
The job ends when every task has its verdict. With high in fail-on, it also waits for the report, whose findings it reads; a wait that runs out before the report is written cannot decide.
When the wait runs out, the check goes on. Re-running the job while it runs picks it up; re-running it once the check is done checks the build again.
Options
| Input | What it does |
|---|---|
api-key | Required. The CI key, from a secret. |
url | The preview to check. Leave it empty on deployment_status to take the deployment's address. |
tasks | Task links, one per line. They replace the tasks Scout would read off the pull request. |
instruction | What to check, in words, on top of the tasks. |
tracked-tasks | true also checks every task the project tracks, each on its own pages of the preview — see Tracked tasks. |
login, password | A test account Scout signs in with first. Pass the password from a secret. Add sign-in-url when Scout cannot find the sign-in page. The project's saved Scout test account is not used by a pipeline check. |
headers | Name: value lines Scout sends to the preview — see Protected previews. |
allow-destructive | true lets Scout complete flows that change data, like allow destructive actions on the Scout form. Only on a preview with test data. |
fail-on | What fails the job. Unset: the project's Block merges rule while it is On, else broken,inconclusive. |
timeout-minutes | How long the job waits for the verdict. Default 30. |
budget-tokens | The most this one check may spend. Default 500 plus 25 for each task; a finished check spends what its checks need, not the cap. |
width | desktop (default), mobile or both. |
comment | false keeps the verdict out of the pull request; the job summary still has it. |
The step's outputs are verdict, run-url, spent-tokens, broken-count and exit-reason, for the steps after it.
Tracked tasks
A tracked task is a flow the project keeps checking on every build, whatever the change names — "a visitor can apply a promo code at checkout". Add them under Settings → Project → Tracked tasks:
- Goal: what a visitor must be able to do, in words.
- Pages: the paths the task is checked on, such as
/pricingor/checkout?plan=pro. Each page is a check that starts there, on the address being checked — so the same list serves a preview, staging and production. - Passes when: what the screen shows when it works, one claim per line. Left empty, the goal itself is the claim.
- Needs: a sign-in, or completing a flow that changes data. A check that needs a sign-in without a test account, or a data change without
allow-destructive, is listed as Not checked with the reason.
Set tracked-tasks: true (--tracked-tasks in other CI, "trackedTasks": true in the API) and every tracked task rides along with the change's own tasks, each with its verdict in the comment. Check now on the same card checks them on the project's site, signed in with the project's test account when it has one. A check budgets 25 tokens more for each tracked task, as for any task.
Protected previews
A preview behind Vercel Deployment Protection or a password lets Scout in with a header. Add Vercel's Protection Bypass for Automation secret to the repository and uncomment the headers lines of the workflow:
headers: |
x-vercel-protection-bypass: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}Scout sends these headers only to the preview's own requests, never to a third-party script on the page. The key, the header values and the password are masked in the job log.
Without the header, Scout meets the Vercel login instead of your app. It does not check that other site: the check is Couldn't check, error reads "the address leads to vercel.com" and the comment says so. Checks Flamio starts itself after a staging deploy take the bypass saved on Delivery instead, see Let Scout into a protected preview.
Other CI
GitLab, Bitbucket, Jenkins or CircleCI run the same check from the command line, with the same exit codes:
FLAMIO_CI_KEY=$FLAMIO_CI_KEY npx @flamioai/cli scout check \
--url "$PREVIEW_URL" \
--report-file scout-report.mdGitLab and Bitbucket fill the repository, commit and branch on their own; a GitLab merge request also its title and description. On a Bitbucket pull request, add a repository access token with Pull requests: Write as the secured variable FLAMIO_BITBUCKET_TOKEN: the step then reads the pull request's title, description, commits and changed files, and keeps one comment on it up to date — the same checklist as on GitHub. --environment <name> names where the build is deployed, so the check shows on that environment in Delivery. --task, --tracked-tasks, --header, --login (with FLAMIO_PASSWORD in the environment), --fail-on and --timeout-minutes match the inputs above. flamio scout check --help lists every flag, and flamio --version prints the CLI's version for the job's log.
With GitHub or Bitbucket connected and Show Scout results in the host on, the check also shows on its commit there — in progress while it runs, then its verdict and its findings.
Call the API yourself
POST https://api.flamio.org/api/scout-checks with Authorization: Bearer <CI key> starts a check, and answers at once with its runId:
curl -sS https://api.flamio.org/api/scout-checks \
-H "Authorization: Bearer $FLAMIO_CI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://preview-123.example.com",
"change": {
"sha": "4f2a9c1",
"branch": "feature/KAN-33-signin",
"pr": { "number": 42, "title": "KAN-33: sign in with a magic link" }
}
}'| Field | What it does |
|---|---|
url | Required. The deployed build. |
change | What the build changes: repo, sha, branch, pr (number, title, body, url), commits (sha, message), changedPaths, tasks — task links that replace the ones Scout would find — and environment (name, optionally kind): where the build is deployed, so the check shows on that environment in Delivery. A link to an On-Live Issue in the pull request or a commit names it: Scout does it again on the build first. |
instruction | A task in words. |
trackedTasks | true also checks every task the project tracks, each on its own pages of url. |
siteCredentials | login, password and optionally signInUrl of a test account — used for this run only, never stored. |
siteHeaders | Headers sent to the site's own requests. |
ownershipAttested | true lets Scout complete flows that change data. |
budgetTokens | Where the run stops. |
width | desktop, mobile or both. |
Then read GET https://api.flamio.org/api/scout-checks/RUN_ID until verdict is not running, and stop a check you no longer need with POST https://api.flamio.org/api/scout-checks/RUN_ID/stop. Every answer is wrapped in response, as in the rest of the Flamio API.
verdict | Meaning |
|---|---|
running | Scout is still working, or the verdicts are not on the tasks yet. |
passed | Every task works. |
failed | At least one task is broken. |
inconclusive | The run failed before every task had its verdict, a task could not be checked, or Scout could not get in — for one, the address led to another site. error says why. |
skipped | Nothing in the change shows on a screen. |
reported | No task was given: the report is ready, with no pass or fail. |
phase says where the check is: queued, planning, testing, reporting or done. tasks lists each task with its outcome and reason, the checks Scout planned and what each found. Once the report exists, findings lists the few to act on first and findingCounts counts all of them by severity — only findings Scout is sure enough of to send on its own: a kind of finding measured precise and stable, or one real visitors met on your site. candidates counts the rest, and candidateFindings lists up to 20 of them (same fields as findings, most severe first); they are never posted to a pull request. liveIssues lists the open problems real visitors meet that Scout did again on the build — those the change names first (named) — each with title, visitors, url and result: reproduced, not_reproduced, not_on_page, undecided or not_reached, null until the report. They never count in findings or fail the check. spentTokens is what the run spent. runUrl opens the run in Flamio. Sending the same check while it runs answers with that run and "alreadyRunning": true. A pull request (repo and pr.number) is checked once per commit (sha): a later start of it, from a re-run job, another preview or the Check pull requests rule, answers with that run and "alreadyRunning": true, even after it ended with a verdict. A check that crashed, was stopped or ended inconclusive does not count: re-run the job and the commit is checked again. To check a commit that has a verdict again, push a new commit.
Result
The pull request has one comment, edited as the check goes and push after push. Each task is a checklist, linked to the task on your tracker:
- the checks of the task itself, each ticked once it works, or marked with why it does not — a broken one links its evidence;
- Flows beside the task the change may break — at most two checks of flows the changed files or commits name, which the task does not ask about;
- Not checked — what in the task no screen shows, and why.
Below the tasks, Real visitors lists the open problems On-Live recorded that Scout did again on this build, with how many visitors met each and whether it happens on this build; an Issue the pull request links to comes first. Problems Scout did not do again — on pages the check did not walk, or where the page would not open — are only counted. Then the main findings, how many candidates the run holds back, and Full report. Each tracker task gets the same checklist as a comment, and the run is on the Flamio Scout page with the Tasks card. On Delivery, the Pull request checks step under Finish setting up reads Scout checks pull requests.