{"record":{"id":"484426bca4e33224","repo":"denoland/deno","slug":"github-server-url-environment-variable-is-not-set","errorCode":null,"errorMessage":"GITHUB_SERVER_URL environment variable is not set","messagePattern":"GITHUB_SERVER_URL environment variable is not set","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"cli/tools/publish/provenance.rs","lineNumber":180,"sourceCode":"impl Predicate {\n  pub fn new_github_actions() -> Result<Self, AnyError> {\n    let repo = std::env::var(\"GITHUB_REPOSITORY\").map_err(|_| {\n      anyhow!(\"GITHUB_REPOSITORY environment variable is not set\")\n    })?;\n    let rel_ref = std::env::var(\"GITHUB_WORKFLOW_REF\")\n      .unwrap_or_default()\n      .replace(&format!(\"{}/\", &repo), \"\");\n\n    let (workflow_path, workflow_ref) = if let Some(delimn) = rel_ref.find('@')\n    {\n      let (path, ref_) = rel_ref.split_at(delimn);\n      (path, &ref_[1..])\n    } else {\n      (rel_ref.as_str(), \"\")\n    };\n\n    let server_url = std::env::var(\"GITHUB_SERVER_URL\").map_err(|_| {\n      anyhow!(\"GITHUB_SERVER_URL environment variable is not set\")\n    })?;\n    let github_ref = std::env::var(\"GITHUB_REF\")\n      .map_err(|_| anyhow!(\"GITHUB_REF environment variable is not set\"))?;\n    let github_sha = std::env::var(\"GITHUB_SHA\")\n      .map_err(|_| anyhow!(\"GITHUB_SHA environment variable is not set\"))?;\n    let runner_env = std::env::var(\"RUNNER_ENVIRONMENT\").map_err(|_| {\n      anyhow!(\"RUNNER_ENVIRONMENT environment variable is not set\")\n    })?;\n    let run_id = std::env::var(\"GITHUB_RUN_ID\")\n      .map_err(|_| anyhow!(\"GITHUB_RUN_ID environment variable is not set\"))?;\n    let run_attempt = std::env::var(\"GITHUB_RUN_ATTEMPT\").map_err(|_| {\n      anyhow!(\"GITHUB_RUN_ATTEMPT environment variable is not set\")\n    })?;\n\n    Ok(Self {\n      build_definition: BuildDefinition {\n        build_type: GITHUB_BUILD_TYPE,\n        external_parameters: ExternalParameters {","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/publish/provenance.rs#L162-L198","documentation":"Part of the provenance predicate construction: after resolving the workflow ref, `Predicate::new_github_actions` reads `GITHUB_SERVER_URL` and throws this message when it is unset. This and the other runner variables are always set inside real GitHub Actions jobs, so the error indicates publish-with-provenance ran where the Actions environment was absent or only partially forwarded.","triggerScenarios":"`deno publish --provenance` where GITHUB_REPOSITORY was present but GITHUB_SERVER_URL was not — e.g. a container or subprocess that forwards only a subset of the runner environment.","commonSituations":"Dockerized publish steps with hand-picked `-e` env forwards; scripts that sanitize the environment before invoking deno.","solutions":["Run the publish step directly on the GitHub Actions runner rather than in a stripped container","If containerized, forward GITHUB_SERVER_URL along with the other GITHUB_*/RUNNER_* variables","Drop `--provenance` if not publishing from GitHub Actions"],"exampleFix":"# before — only some runner env forwarded\ndocker run -e GITHUB_REPOSITORY denoland/deno publish --provenance\n# after — forward the full Actions environment\ndocker run -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_REF \\\n  -e GITHUB_SHA -e GITHUB_RUN_ID -e GITHUB_RUN_ATTEMPT \\\n  -e RUNNER_ENVIRONMENT -e ACTIONS_ID_TOKEN_REQUEST_URL \\\n  -e ACTIONS_ID_TOKEN_REQUEST_TOKEN denoland/deno publish --provenance","handlingStrategy":"validation","validationCode":"if [ -z \"$GITHUB_SERVER_URL\" ]; then\n  echo \"GITHUB_SERVER_URL unset — publish --provenance needs the full Actions env\" >&2\n  exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the publish step directly on the runner rather than in an env-stripped container","Forward the complete Actions environment when containerization is required","Add a preflight loop over the required GITHUB_*/RUNNER_* variables in CI"],"tags":["publish","provenance","github-actions","environment","sigstore"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}