GitHub Action
nullean/silk is a GitHub Action: it installs silk, runs a suite with --junit, uploads the results and fails the job when a
scenario fails. It does not install an agent or log in to one: do that in a step before it, because it differs for each agent.
jobs:
evaluate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- run: npm install --global @anthropic-ai/[email protected]
- uses: nullean/[email protected] # see "Which ref" below
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
suite: suites/my-mcp.silk.yaml
trials: 3
max-cost-usd: 5
- v7.0.1
In GitHub Actions silk also prints an ::error annotation per failed scenario and writes the report to the job's step summary; see
In CI.
Anthropic workload identity federation lets the job trade its GitHub OIDC token for a short-lived Anthropic token, so no
ANTHROPIC_API_KEY is stored. silk's own live.yml runs this way against the real claude CLI (2.1.334): the agent and the judge both
authenticate through it, and the example suite passed.
permissions:
id-token: write
env:
ANTHROPIC_FEDERATION_RULE_ID: fdrl_...
ANTHROPIC_ORGANIZATION_ID: ...
ANTHROPIC_SERVICE_ACCOUNT_ID: svac_...
ANTHROPIC_WORKSPACE_ID: wrkspc_...
ANTHROPIC_IDENTITY_TOKEN_FILE: /tmp/anthropic-identity-token
steps:
- name: Fetch the GitHub OIDC token
run: |
set -euo pipefail
jwt=$(curl -sSf -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://api.anthropic.com" | jq -r '.value')
echo "::add-mask::$jwt"
umask 077
printf '%s' "$jwt" > "$ANTHROPIC_IDENTITY_TOKEN_FILE"
- Set up the rule in the Claude Console (an organization admin; Workload identity, Connect workload, GitHub Actions). The IDs are identifiers, not secrets.
- No other credential may be set.
ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKEN, anapiKeyHelperorCLAUDE_CODE_OAUTH_TOKENtakes precedence over the federation, andclaude --bareignores it. - Match the token's real claims. If your organization uses GitHub's immutable subject format, the
subclaim isrepo:<owner>@<id>/<repo>@<id>:ref:refs/heads/main, notrepo:<owner>/<repo>:..., and a rule written from the plain form is denied withmatch_subject_prefix. Print the claims (never the token) to see them, and read the deny reason under the Console's authentication history. Constrain the rule withrepository,repository_owner,reforjob_workflow_refclaims, not only a prefix; a rule that does not pin the repository and branch would also accept pull requests from forks. - Not verified: the rule above was exercised only by a manual run on the default branch. A single run's token is exchanged more than once (the agent and the judge each exchange it); that worked here, but the exchange is documented as single use per token, so a long suite that outlives the token should be tested before you rely on it.
- From 0.2.0. The action was added after
0.1.0, sonullean/[email protected]has noaction.yml; use0.2.0or later. - An exact tag (
nullean/[email protected]) installs exactly that silk, so an eval run is reproducible. A floating tag (nullean/[email protected]) follows the 0.2.x patches and installs the latest silk. While silk is 0.x a breaking change bumps the minor version, so the floating tag isv0.<minor>, neverv0; from 1.0 it isv<major>. - A branch or a SHA installs the latest released silk, since neither names a version. Set
versionto pin it.
| Input | Default | Meaning |
|---|---|---|
suite |
required | The suite file, relative to working-directory. |
agent |
claude |
claude, codex, cursor, copilot, gemini or opencode. It must be installed and logged in already. |
trials, arm, scenario, judge, max-cost-usd |
empty | Passed to silk run as --trials, --arm, --scenario, --judge, --max-cost-usd when set. |
args |
empty | Extra arguments for silk run, split on spaces. |
version |
the ref's version, or the latest | The silk version to install. |
working-directory |
. |
Where the suite is, and where relative paths start. |
junit |
.silk-ci/results.xml |
Where the JUnit XML goes. |
output |
.silk-ci/run |
Where the run folder (report.md, transcripts) goes. |
upload |
true |
Upload the JUnit file and the run folder as an artifact, whether or not the run passed. |
artifact-name, retention-days |
silk-results, 14 |
The artifact's name and how long it lives. |
exit-code is silk's own (0 all passed, 1 a scenario failed, 2 usage, 3 an agent run or a report write failed), junit and
run-directory are the paths above. The results are uploaded before the job fails, so a failing run still leaves its report.
The action's scripts (build/action-version.sh, build/action-run.sh) have offline tests against a fake silk, mutation-checked, and run
in CI on Linux and Windows; the action file is linted with zizmor. The repository's live workflow runs it on demand against the real
claude CLI with the credential-free examples/hello suite. Not verified: a run on a Windows or macOS runner (the Windows tool shim is
handled but untried), and any agent other than claude through the action.