AWS codebuild: Document new read-only self-hosted runner build environment variables
Summary
Adds documentation for CODEBUILD_RUNNER_TYPE and CODEBUILD_WEBHOOK_JOB_URL, and lists the read-only environment variables (runner owner/repo/domain/type, webhook run/job/workflow/job URL) returned for self-hosted runner builds in BatchGetBuilds and the console.
Security assessment
The change only documents new build environment variables and explicitly notes they are read-only and cannot be overridden, which is a functional/observability addition rather than a fix for a specific vulnerability. No credential, authz, or encryption behavior is described.
Evidence
+You can use these variables to find the workflow run and job that started a build. These variables are read-only. You cannot set them in a project or in a build override.
Diff
diff --git a/codebuild/latest/userguide/build-env-ref-env-vars.md b/codebuild/latest/userguide/build-env-ref-env-vars.md index d538a93..68b6cce 100644 --- a//codebuild/latest/userguide/build-env-ref-env-vars.md +++ b//codebuild/latest/userguide/build-env-ref-env-vars.md @@ -199,0 +200,5 @@ The domain of the repository that triggers the self-hosted runner build. Only sp +CODEBUILD_RUNNER_TYPE + + +The type of self-hosted runner that triggers the build. The value is `GITHUB`, `GITLAB`, or `BUILDKITE`. + @@ -214,0 +220,5 @@ The job ID of the job associated with the build. +CODEBUILD_WEBHOOK_JOB_URL + + +The URL of the GitHub Actions job associated with the build. This variable is set only when the webhook payload contains the job URL. + @@ -224,0 +235,23 @@ If a buildspec override is configured in the self-hosted runner request labels, +For self-hosted runner builds, CodeBuild also returns the following variables in the `environmentVariables` list of the build environment in the [BatchGetBuilds](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BatchGetBuilds.html) response. The CodeBuild console also shows them. + + * `CODEBUILD_RUNNER_OWNER` + + * `CODEBUILD_RUNNER_REPO` + + * `CODEBUILD_RUNNER_REPO_DOMAIN` + + * `CODEBUILD_RUNNER_TYPE` + + * `CODEBUILD_WEBHOOK_RUN_ID` + + * `CODEBUILD_WEBHOOK_JOB_ID` + + * `CODEBUILD_WEBHOOK_WORKFLOW_NAME` + + * `CODEBUILD_WEBHOOK_JOB_URL` + + + + +You can use these variables to find the workflow run and job that started a build. These variables are read-only. You cannot set them in a project or in a build override. +