Skip to content

GitHub Actions

Two actions run anthropics/claude-code-action through Not Diamond Code. setup installs Not Diamond Code on the runner and points the job’s later Claude Code steps at it. stop records the job’s usage before the runner shuts down. Both live in the Not-Diamond/notdiamond-code-actions repository.

  • NOTDIAMOND_ACTIONS_TOKEN, a GitHub token with read access to Not-Diamond/notdiamond-code-actions. Not Diamond provides it when the repository is shared with your organization.
  • NOTDIAMOND_TOKEN, a child service-account token. Mint it from a root token with the API, as described in CI Tokens. The dashboard mints only root tokens, and Not Diamond Code refuses a root token. A child expires after 7 days by default and never outlives its root, so mint one per run or rotate the secret.
  • Your model provider key. ANTHROPIC_API_KEY for anthropic mode, AWS_BEARER_TOKEN_BEDROCK for bedrock mode.
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: Not-Diamond/notdiamond-code-actions
token: ${{ secrets.NOTDIAMOND_ACTIONS_TOKEN }}
path: .notdiamond-actions
- uses: ./.notdiamond-actions/setup
with:
notdiamond_token: ${{ secrets.NOTDIAMOND_TOKEN }}
credential: anthropic # or bedrock / forwarded
api_key: ${{ secrets.ANTHROPIC_API_KEY }}
- uses: ./.notdiamond-actions/stop
- uses: anthropics/claude-code-action@v1
with:
prompt: "..."
anthropic_api_key: notdiamond-proxy # any value in anthropic and bedrock modes

The second checkout places the actions under .notdiamond-actions in the workspace. Add ref: to that step to pin a tag or commit of the actions repository. If your job checks out your own repository into a subdirectory, keep the actions checkout at a path of its own.

Place stop right after setup. It runs at the end of the job, after the Claude Code steps.

Input Default Meaning
notdiamond_token required Child service-account token.
credential anthropic Which key Not Diamond Code uses: anthropic, bedrock or forwarded.
api_key Your Anthropic or Bedrock key, for anthropic and bedrock modes.
region AWS region for bedrock mode.
gateway_url Gateway URL for forwarded mode.
version latest Not Diamond Code release to install: a channel (latest, next), a version, or a tarball path or URL.
transcripts true Upload session transcripts from the runner.

The action’s version output reports the release it installed.

In anthropic and bedrock modes Not Diamond Code uses the key you give setup, so the Claude Code action’s anthropic_api_key can hold any value. In forwarded mode it uses the key you give the Claude Code action, so anthropic_api_key must be a real Anthropic key. A claude.ai subscription login cannot be used on a runner.

If you pass the Claude Code action a settings value with its own hooks key, or --bare in claude_args, Not Diamond Code picks a model for the job’s first request and uses it for the rest of the job.

Each run shows up on the dashboard under the token’s service account.