You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: action.yml
+34-22Lines changed: 34 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ inputs:
20
20
required: false
21
21
default: 'https://auduihjmm4b735zci7vyabuikq0hppqn.lambda-url.us-east-1.on.aws'# prod gha_proxy Function URL (licensing-aws LicensingStack-Stateless-prod)
22
22
license_key:
23
-
description: 'A CodeBoarding license key (e.g. secrets.CODEBOARDING_LICENSE) for unmetered hosted usage via proxy_url. Takes precedence over the free OIDC tier; ignored when llm_api_key is set (BYO key talks to the provider directly).'
23
+
description: 'A CodeBoarding license key (e.g. secrets.CODEBOARDING_LICENSE) for unmetered hosted usage via proxy_url. Requires "permissions: id-token: write" — the license rides the OIDC bearer (the proxy still verifies the OIDC identity, then the license skips the quota). Takes precedence over the free OIDC tier; ignored when llm_api_key is set (BYO key talks to the provider directly).'
24
24
required: false
25
25
default: ''
26
26
github_token:
@@ -547,9 +547,10 @@ runs:
547
547
548
548
# ── Hosted modes (license / oidc): provider is always OpenRouter via proxy ──
549
549
# The hosted tiers run on CodeBoarding's OpenRouter account, so the engine
550
-
# always talks OpenRouter here (the bearer is the license/OIDC token, which
551
-
# the proxy swaps for the real key). To use a DIFFERENT provider, set
552
-
# llm_api_key for that provider (that's BYO-key mode, below).
550
+
# always talks OpenRouter here. The bearer is the OIDC JWT (free) or the OIDC
551
+
# JWT packed with the license (license mode); the proxy verifies the OIDC,
552
+
# applies the license, and swaps in the real OpenRouter key. To use a DIFFERENT
553
+
# provider, set llm_api_key for that provider (that's BYO-key mode, below).
553
554
if [ "$MODE" != "byokey" ]; then
554
555
if [ -z "$PROXY_URL" ]; then
555
556
echo "::error::proxy_url is empty but no llm_api_key was provided. Set llm_api_key, or restore proxy_url."
# Both hosted tiers (free + license) authenticate to the proxy with a
570
+
# GitHub OIDC JWT — it's the unforgeable per-repo identity the proxy meters
571
+
# and abuse-checks on, so it is mandatory even when a license is present.
572
+
# The engine (ChatOpenAI) can only set the bearer, not a custom header, so a
573
+
# license rides the bearer alongside the OIDC token as `<jwt>~cblic~<license>`;
574
+
# the proxy splits on that separator (KEEP IN SYNC with gha_proxy handler).
575
+
# ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN are injected into the runner process env
576
+
# (NOT the `env` context) only when the job grants `id-token: write`; read them
577
+
# directly from the shell env.
578
+
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then
579
+
echo "::error::No GitHub OIDC token available. Add \`permissions: id-token: write\` to the job (the hosted tier — free and license — needs the OIDC token to identify your repository; an llm_api_key avoids the proxy entirely)."
echo "::error::Failed to mint a GitHub OIDC token (is \`permissions: id-token: write\` granted?)."
588
+
exit 1
589
+
fi
590
+
echo "::add-mask::$OIDC_JWT"
591
+
568
592
if [ "$MODE" = "license" ]; then
569
-
BEARER="$LICENSE"
570
-
echo "Using CodeBoarding license via hosted proxy."
593
+
# Pack the license after the OIDC JWT; the proxy verifies the JWT (identity)
594
+
# and validates the license (skips the free quota). Mask both halves.
595
+
echo "::add-mask::$LICENSE"
596
+
BEARER="${OIDC_JWT}~cblic~${LICENSE}"
597
+
echo "Using CodeBoarding license via hosted proxy (OIDC-identified)."
571
598
else
572
-
# Mint a GitHub Actions OIDC JWT (audience must match the proxy's).
573
-
# ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN are injected into the runner
574
-
# process env (NOT the `env` context) only when the job grants
575
-
# `id-token: write`; read them directly from the shell env.
576
-
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then
577
-
echo "::error::No GitHub OIDC token available. Add \`permissions: id-token: write\` to the job (or set an llm_api_key / license_key). The free hosted tier needs the OIDC token to identify your repository."
0 commit comments