From 3543934c784dd0945707e7d9a578b29f4c190641 Mon Sep 17 00:00:00 2001 From: Eleftheria Stein-Kousathana Date: Thu, 3 Sep 2026 11:47:47 +0200 Subject: [PATCH] Route Claude workflows through Stacklok AI gateway Replace the shared ANTHROPIC_API_KEY with per-workflow gateway keys (STACKLOK_GATEWAY_KEY_CLAUDE_TAG, STACKLOK_GATEWAY_KEY_SLACK_NOTIFICATION, STACKLOK_GATEWAY_KEY_RELEASE_DOCS) and point each claude-code-action step at the Stacklok AI gateway via ANTHROPIC_BASE_URL. --- .github/workflows/autogen-docs-notify.yml | 4 +++- .github/workflows/claude.yml | 4 +++- .github/workflows/upstream-release-docs.yml | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autogen-docs-notify.yml b/.github/workflows/autogen-docs-notify.yml index 33f5fbd3..82f87bae 100644 --- a/.github/workflows/autogen-docs-notify.yml +++ b/.github/workflows/autogen-docs-notify.yml @@ -153,8 +153,10 @@ jobs: - name: Compose reviewer summary if: steps.pr.outputs.skip != 'true' uses: anthropics/claude-code-action@3f854a8fb5146b39d5cbf8b57f70d80810e1366f # v1.0.198 + env: + ANTHROPIC_BASE_URL: https://llm-gateway.stacklok.dev/anthropic with: - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + anthropic_api_key: ${{ secrets.STACKLOK_GATEWAY_KEY_SLACK_NOTIFICATION }} # Skips claude-code-action's OIDC -> GitHub App token exchange # (which needs id-token: write) and uses the job's own minimally # scoped GITHUB_TOKEN instead. Unrelated to anthropic_api_key, diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 136dcca3..a4132465 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -57,8 +57,10 @@ jobs: - name: Run Claude Code id: claude uses: anthropics/claude-code-action@3f854a8fb5146b39d5cbf8b57f70d80810e1366f # v1.0.198 + env: + ANTHROPIC_BASE_URL: https://llm-gateway.stacklok.dev/anthropic with: - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + anthropic_api_key: ${{ secrets.STACKLOK_GATEWAY_KEY_CLAUDE_TAG }} additional_permissions: | actions: read claude_args: | diff --git a/.github/workflows/upstream-release-docs.yml b/.github/workflows/upstream-release-docs.yml index dfad18d1..ead6345b 100644 --- a/.github/workflows/upstream-release-docs.yml +++ b/.github/workflows/upstream-release-docs.yml @@ -700,8 +700,10 @@ jobs: # below for a runaway-cost ceiling. timeout-minutes: 45 uses: anthropics/claude-code-action@3f854a8fb5146b39d5cbf8b57f70d80810e1366f # v1.0.198 + env: + ANTHROPIC_BASE_URL: https://llm-gateway.stacklok.dev/anthropic with: - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + anthropic_api_key: ${{ secrets.STACKLOK_GATEWAY_KEY_RELEASE_DOCS }} additional_permissions: | actions: read # Allow the action to run when the triggering PR was opened @@ -862,8 +864,10 @@ jobs: # spirals on a file it can't stop "improving". timeout-minutes: 10 uses: anthropics/claude-code-action@3f854a8fb5146b39d5cbf8b57f70d80810e1366f # v1.0.198 + env: + ANTHROPIC_BASE_URL: https://llm-gateway.stacklok.dev/anthropic with: - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + anthropic_api_key: ${{ secrets.STACKLOK_GATEWAY_KEY_RELEASE_DOCS }} additional_permissions: | actions: read allowed_bots: 'renovate'