Lab 7: Evals in CI
Your skill passes now. The eval’s job changes: from “can the agent do this yet?” to “does it still do it?” In this lab, GitHub Actions runs the eval on every pull request that touches the skill, and posts the result as a comment. Then you try to bring the bug back, and watch the eval catch it.
- changed
- seen before, different here
- You do
- Run the eval on every pull request with GitHub Actions, then bring the bug back and watch CI flag it.
- Under test
- Every change to the skill, automatically
- Checked by
- The smoke suite: the code checks from Lab 3
- Task Write the release notes from
backlog.json - Agent changed GitHub Copilot, in GitHub Actions
- Environment changed The skill from the pull request
- Trials 3 per pull request
- Checks Answer, transcript and workspace, as in Lab 3
- LLM judge Not used here
- Results changed A check and a comment on the pull request
gh pr create --fill - new
- first time in the workshop
- You
- Pull request on GitHub
- GitHub Actions the Evals workflow
- Vally with GitHub Copilot
- You to Pull request: Opens a pull request It changes the skill, so the workflow's paths match.
- Pull request to GitHub Actions: Starts the Evals workflow For every pull request that changes the skill or the evals.
- GitHub Actions: Signs in and installs Vally new With the job's own token and
copilot-requests: write: no secret needed. - GitHub Actions to Vally: Runs the smoke suite new Lint first, then every eval tagged
lane: ci, with--require-pass. - Vally: Runs the trials and the checks Three trials of the agent, five checks each, as in Lab 3.
- Vally to GitHub Actions: Verdicts and evidence A failed eval fails the job.
- GitHub Actions to Pull request: Posts a check and one comment new The comment shows the score, the threshold and the tokens.
- Pull request to You: Shows the result Merge when it's green; otherwise read the evidence and fix.
The pieces you’ll work with
Section titled “The pieces you’ll work with”- Regression eval new
-
An eval that guards behavior that already works. It should pass close to 100% of the time; a failure means something broke.
- Tag new
-
A key-value label on an eval, used to select evals for a suite.
- Suite new
-
A named group of evals. The
smokesuite runs every eval taggedlane: ci. -
github/evals-actionnew -
A GitHub Action that installs Vally, lints your project, runs a suite and posts one sticky comment on the pull request with the results.
-
copilot-requests: writenew -
A workflow permission that lets the job's own token run Copilot as the agent under test. No secret or personal token is needed.
Before you start
Section titled “Before you start”- You need your own copy of the starter repository (Use this template) with GitHub Actions enabled, and a Codespace or clone of it.
- You need the GitHub CLI,
gh, signed in to your account. A Codespace has it ready. On your computer, you signed in during setup;gh auth statusshows your account. - Who pays: in a personal repository, the runs use the repository owner’s Copilot plan. In an organization’s repository, an organization owner must allow Copilot CLI billed to the organization, and each pull request from within the repository can start runs that the organization pays for.
- Labs 3 and 4 should be done:
scripts/catch-up.sh 4if not.
-
Tag the eval for the CI suite. In
evals/release-notes.eval.yaml, add these two lines below thetype: capabilityline, at the same indentation astype:tags:lane: ci # selected by the smoke suite in .vally.yaml.vally.yaml, in the repository root, defines the suite:smokeruns every eval taggedlane: ci. -
Run the suite locally first, so you know what CI will see:
Terminal window vally eval --suite smokeOnly the tagged eval runs: three trials, all passing with the fixed skill.
-
Add the workflow:
Terminal window mkdir -p .github/workflowscp lab-files/lab-7/evals.yml .github/workflows/evals.ymlRead it. The important parts:
.github/workflows/evals.yml (excerpt) on:pull_request:paths:- .github/skills/** # run when the skill changes …- evals/** # … or an eval, the data, the config, the workflowjobs:evals:permissions:contents: readcopilot-requests: write # the job's token runs the agent under test with Copilotpull-requests: write # the action posts one sticky commentsteps:- uses: actions/checkout@v7- uses: github/evals-action@v0with:working-directory: evalssuite: smokevally-version: '0.21.0'working-directory: evalskeeps the action to theevals/folder: it lints every eval file in its working directory, and the starters inlab-files/andsolutions/work only once you copy them intoevals/. Vally finds.vally.yamlin the repository root by itself. -
Commit and push your work to
main:Terminal window git add -Agit commit -m "Run the release-notes eval on pull requests"git push.gitignorekeeps your run results,.envand params files out of the commit. -
Now bring the bug back, in a pull request:
Terminal window git switch -c try-the-old-skillcp skill-versions/before/release-notes/SKILL.md .github/skills/release-notes/SKILL.mdgit commit -am "Try the original release-notes skill"git push -u origin try-the-old-skillgh pr create --fill -
Watch the check:
Terminal window gh pr checks --watchThe Evals check fails after a few minutes. The action runs
vally evalwith--require-passfor you, so a failed eval fails the job, as you saw in Lab 2. Open the pull request in the browser (gh pr view --web). The action’s comment, shortened:Evals: failedSuite: smokeLint: validated (no model execution) - EvidenceRun: failed - 3 trials - Evidence| Eval | Trials | Result || release-notes-completed-only | 3 | failed || Eval | Verdict | Score | Duration | Tokens || release-notes-completed-only | failed | 0.80 (threshold 1.00) | 14487ms | 152347 tokens |The comment names the eval, not the check. But the score is one you know: 0.80 means four of five checks passed, as in Lab 3. To see which check failed and why, run the suite on the branch yourself,
vally eval --suite smoke, and read the results as in Lab 3: it’sleaves-out-unfinished-export, because the answers announce CT-102 again. GitHub still lets you merge the pull request: a failing check blocks merging only once you require it; see Go further. -
Close the pull request without merging, and go back to
main:Terminal window gh pr close --delete-branchgit switch main
What just happened
Section titled “What just happened”Your eval graduated from a capability eval to a regression check. Anyone who changes the skill now gets the eval’s verdict on their pull request, with evidence, before a reviewer even looks. And the action used the job’s own token with the copilot-requests: write permission: no personal token, no stored secret.
Check yourself
Section titled “Check yourself”Why run the suite locally before pushing the workflow?
To know what CI will see: if the eval fails or errors locally, it fails in CI too, after a slower round trip. Run locally, push when it’s green.
Why doesn’t the workflow run for pull requests from forks?
The job condition github.event.pull_request.head.repo.full_name == github.repository skips them. A pull request from a fork could change the evals or the skill to do anything with the job’s Copilot access, at your cost.
Solution
Section titled “Solution”Compare your files with ours. In the eval, the highlighted lines are the tag you add in step 1. The workflow is the file you copy in step 3, in full.
The eval, tagged for CI
# Lab 7 solution: the Lab 3 eval, tagged for the CI suite. It now guards behavior that works,# so every pull request runs it: a passing capability eval graduates into a regression check.name: release-notes-completed-onlydescription: The release-notes skill announces completed work only and leaves the in-progress status in backlog.json alone.type: capability # intent: "can the agent do this yet?" (a regression eval guards what already works)tags: lane: ci # selected by the smoke suite in .vally.yamldefaults: executor: copilot-sdk # the agent under test: GitHub Copilot, driven through the Copilot SDK model: claude-sonnet-5.5 # pinned, so results are comparable (scripts/use-model.sh changes it) runs: 3 # trials per stimulus: agents aren't deterministic, so one run proves little timeout: 120s # per trialagent_environment: # what the agent finds in its workspace, rebuilt for every trial skills: - ../.github/skills/release-notes # the skill under test (paths are relative to this file) files: - src: ../backlog.json # copied into the workspace as backlog.json dest: backlog.jsonscoring: threshold: 1 # a trial passes only when every check passesstimuli: - name: completed-work-only prompt: Write the release notes for this release from backlog.json. graders: # Code checks on the final answer (the outcome you can see) - type: output-contains name: leaves-out-unfinished-export config: { substring: CT-102, negate: true } # passes when CT-102 is NOT in the answer - type: output-contains name: includes-done-search config: { substring: CT-101 } - type: output-contains name: includes-done-dark-mode config: { substring: CT-103 } # A check on the transcript (how the agent got there) - type: skill-invocation name: release-notes-skill-used config: required: - release-notes # A check on the workspace (side effects): backlog.json still contains the in-progress status - type: file-contains name: backlog-still-in-progress config: path: backlog.json value: '"status": "in-progress"'The workflow
# Lab 7: run the smoke suite on every pull request and post the result as a PR comment.# Copy it into place: mkdir -p .github/workflows && cp lab-files/lab-7/evals.yml .github/workflows/evals.yml## Billing: in a personal repository, the runs use the repository owner's Copilot seat. In an# organization repository, an admin must allow "Copilot CLI billed to the organization".name: Evals
on: pull_request: paths: - .github/skills/** - evals/** - backlog.json - .vally.yaml - .github/workflows/evals.yml workflow_dispatch:
permissions: contents: read
jobs: evals: # Run for manual starts and for pull requests from this repository (not from forks). if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest timeout-minutes: 15 permissions: contents: read copilot-requests: write # lets the job's own token run the agent under test with Copilot pull-requests: write # lets the action post and update one sticky PR comment concurrency: group: evals-${{ github.workflow_ref }} cancel-in-progress: false steps: - uses: actions/checkout@v7 with: persist-credentials: false - uses: github/evals-action@v0 with: # Lint and run only evals/. lab-files/ and solutions/ hold starters that work only once # copied into evals/. Vally finds .vally.yaml in the repository root by itself. working-directory: evals suite: smoke # runs the evals tagged lane: ci vally-version: '0.21.0'Stuck?
Section titled “Stuck?”- The workflow doesn’t start: the pull request must change a file under one of the
paths, and Actions must be enabled in your repository’s settings. - The job fails before running evals: read the log of the lint step. An eval with a lint error stops the whole suite; run
vally lint -e evals --strictlocally to find it. - Copilot isn’t allowed in Actions (organization repositories): ask an organization owner to allow Copilot CLI billed to the organization.
gh pr createasks questions: answer them, or add--title "Try the original skill" --body "Lab 7".
Go further
Section titled “Go further”- Make the check block merging: in your repository’s Settings > Rules > Rulesets, create a branch ruleset for
mainwith Require status checks to pass, and add the Evals check. Remove the workflow’spathsfilter at the same time: a required check that never runs, because a pull request didn’t touch those paths, stays pending and blocks that pull request. - Pin the actions to commit SHAs instead of tags, as you would for production workflows.
- Add the known-good controls from Lab 2 as a second suite, gated with
--require-pass. - Read the GitHub Copilot Evals CI setup journey and the
github/evals-actionREADME.
Next: Lab 8: Compare models
Workshop created by Jeffrey Groneberg · Connect on LinkedIn
The illustrations are AI-generated (MAI-Image-2.6). Command output comes from real runs with Vally 0.21.0 in November 2026.