ably / repository-audit

Oversight for our estate of repositories, in particular those in the public domain. Audit. Monitor. Conform.
Apache License 2.0
11 stars 2 forks source link

Explore GitHub workflow runtime environment #14

Closed QuintinWillison closed 3 years ago

QuintinWillison commented 3 years ago

Introduces an env command into the check workflow. This is being used to explore the environment variables that GitHub's runtime environment makes available to us as it's not always obvious from their documentation what exactly they do. I'm writing code to parse them so want to understand their behaviours.

I will add two comments to this pull request:

  1. env when the workflow runs in the context of this pull request: here
  2. env when the workflow runs on the main branch: to come
QuintinWillison commented 3 years ago

The env from this run against this pull request, in draft state, with underlying branch explore-github-environment:

SELENIUM_JAR_PATH=/usr/share/java/selenium-server-standalone.jar
GOROOT_1_17_X64=/opt/hostedtoolcache/go/1.17.1/x64
CONDA=/usr/share/miniconda
GITHUB_WORKSPACE=/home/runner/work/repository-audit/repository-audit
JAVA_HOME_11_X64=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_36fd8ecf-4e43-46e7-a3bf-9ef799a3d785
GITHUB_ACTION=__run
JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
GITHUB_RUN_NUMBER=28
RUNNER_NAME=Hosted Agent
GRADLE_HOME=/usr/share/gradle-7.2
XDG_CONFIG_HOME=/home/runner/.config
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
ANT_HOME=/usr/share/ant
JAVA_HOME_8_X64=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64
HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
HOMEBREW_SHELLENV_PREFIX=/home/linuxbrew/.linuxbrew
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=3650
BOOTSTRAP_HASKELL_NONINTERACTIVE=1
***
PIPX_BIN_DIR=/opt/pipx_bin
DEPLOYMENT_BASEPATH=/opt/runner
GITHUB_ACTIONS=true
ANDROID_NDK_LATEST_HOME=/usr/local/lib/android/sdk/ndk/22.1.7171670
GITHUB_SHA=f79a3b624475e47848eea92758d53b13a526bb4e
POWERSHELL_DISTRIBUTION_CHANNEL=GitHub-Actions-ubuntu20
DOTNET_MULTILEVEL_LOOKUP=0
GITHUB_REF=refs/pull/14/merge
RUNNER_OS=Linux
HOME=/home/runner
GITHUB_API_URL=https://api.github.com
LANG=C.UTF-8
RUNNER_TRACKING_ID=github_557037e2-1454-46b0-b18e-cc4a6afc83fd
STATS_KEEPALIVE=false
RUNNER_TEMP=/home/runner/work/_temp
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_36fd8ecf-4e43-46e7-a3bf-9ef799a3d785
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
INVOCATION_ID=ee10c6dd08a44fc7ba2e741e58945962
GITHUB_EVENT_NAME=pull_request
GITHUB_RUN_ID=1290566243
ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk-bundle
HOMEBREW_NO_AUTO_UPDATE=1
GITHUB_ACTOR=QuintinWillison
NVM_DIR=/home/runner/.nvm
SGX_AESM_ADDR=1
GITHUB_RUN_ATTEMPT=1
ANDROID_HOME=/usr/local/lib/android/sdk
GOROOT_1_14_X64=/opt/hostedtoolcache/go/1.14.15/x64
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
ACCEPT_EULA=Y
RUNNER_USER=runner
USER=runner
GITHUB_SERVER_URL=https://github.com
HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
PIPX_HOME=/opt/pipx
GECKOWEBDRIVER=/usr/local/share/gecko_driver
CHROMEWEBDRIVER=/usr/local/share/chrome_driver
SHLVL=1
ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg
RUNNER_TOOL_CACHE=/opt/hostedtoolcache
HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
ImageVersion=20210919.1
DOTNET_NOLOGO=1
GRAALVM_11_ROOT=/usr/local/graalvm/graalvm-ce-java11-21.2.0
GITHUB_JOB=check
AZURE_EXTENSION_DIR=/opt/az/azcliextensions
PERFLOG_LOCATION_SETTING=RUNNER_PERFLOG
GITHUB_REPOSITORY=ably/repository-audit
CHROME_BIN=/usr/bin/google-chrome
ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk-bundle
GITHUB_RETENTION_DAYS=90
JOURNAL_STREAM=8:22533
RUNNER_WORKSPACE=/home/runner/work/repository-audit
LEIN_HOME=/usr/local/lib/lein
LEIN_JAR=/usr/local/lib/lein/self-installs/leiningen-2.9.7-standalone.jar
GITHUB_ACTION_REPOSITORY=
PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/runner/.local/bin:/opt/pipx_bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
RUNNER_PERFLOG=/home/runner/perflog
GITHUB_BASE_REF=main
CI=true
SWIFT_PATH=/usr/share/swift/usr/bin
ImageOS=ubuntu20
GITHUB_REPOSITORY_OWNER=ably
GITHUB_HEAD_REF=explore-github-environment
GITHUB_ACTION_REF=
GITHUB_WORKFLOW=.github/workflows/check.yml
DEBIAN_FRONTEND=noninteractive
GOROOT_1_15_X64=/opt/hostedtoolcache/go/1.15.15/x64
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
GOROOT_1_16_X64=/opt/hostedtoolcache/go/1.16.8/x64
_=/usr/bin/env
QuintinWillison commented 3 years ago

The env from this run against main branch, after this PR had landed at https://github.com/ably/repository-audit/commit/37aa814eba9d238fc948ad0957839cb1e3c6869c:

SELENIUM_JAR_PATH=/usr/share/java/selenium-server-standalone.jar
GOROOT_1_17_X64=/opt/hostedtoolcache/go/1.17.1/x64
CONDA=/usr/share/miniconda
GITHUB_WORKSPACE=/home/runner/work/repository-audit/repository-audit
JAVA_HOME_11_X64=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_c215d2de-ef4f-476a-b05e-57c679ac3700
GITHUB_ACTION=__run
JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
GITHUB_RUN_NUMBER=29
RUNNER_NAME=GitHub Actions 5
GRADLE_HOME=/usr/share/gradle-7.2
XDG_CONFIG_HOME=/home/runner/.config
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
ANT_HOME=/usr/share/ant
JAVA_HOME_8_X64=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64
HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
HOMEBREW_SHELLENV_PREFIX=/home/linuxbrew/.linuxbrew
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=3650
BOOTSTRAP_HASKELL_NONINTERACTIVE=1
***
PIPX_BIN_DIR=/opt/pipx_bin
DEPLOYMENT_BASEPATH=/opt/runner
GITHUB_ACTIONS=true
ANDROID_NDK_LATEST_HOME=/usr/local/lib/android/sdk/ndk/23.0.7599858
GITHUB_SHA=37aa814eba9d238fc948ad0957839cb1e3c6869c
POWERSHELL_DISTRIBUTION_CHANNEL=GitHub-Actions-ubuntu20
DOTNET_MULTILEVEL_LOOKUP=0
GITHUB_REF=refs/heads/main
RUNNER_OS=Linux
HOME=/home/runner
GITHUB_API_URL=https://api.github.com
LANG=C.UTF-8
RUNNER_TRACKING_ID=github_0634d623-3577-404f-8ee2-8ad23af7e94d
STATS_KEEPALIVE=false
RUNNER_TEMP=/home/runner/work/_temp
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_c215d2de-ef4f-476a-b05e-57c679ac3700
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
INVOCATION_ID=fb106798b60d4444bee8737e8badcd38
GITHUB_EVENT_NAME=push
GITHUB_RUN_ID=1292100917
ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk-bundle
HOMEBREW_NO_AUTO_UPDATE=1
GITHUB_ACTOR=QuintinWillison
NVM_DIR=/home/runner/.nvm
SGX_AESM_ADDR=1
GITHUB_RUN_ATTEMPT=1
ANDROID_HOME=/usr/local/lib/android/sdk
GOROOT_1_14_X64=/opt/hostedtoolcache/go/1.14.15/x64
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
RUNNER_USER=runner
ACCEPT_EULA=Y
USER=runner
GITHUB_SERVER_URL=https://github.com
HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
PIPX_HOME=/opt/pipx
GECKOWEBDRIVER=/usr/local/share/gecko_driver
CHROMEWEBDRIVER=/usr/local/share/chrome_driver
SHLVL=1
ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg
HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
RUNNER_TOOL_CACHE=/opt/hostedtoolcache
ImageVersion=20210929.1
DOTNET_NOLOGO=1
GRAALVM_11_ROOT=/usr/local/graalvm/graalvm-ce-java11-21.2.0
GITHUB_JOB=check
AZURE_EXTENSION_DIR=/opt/az/azcliextensions
PERFLOG_LOCATION_SETTING=RUNNER_PERFLOG
GITHUB_REPOSITORY=ably/repository-audit
CHROME_BIN=/usr/bin/google-chrome
ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk-bundle
GITHUB_RETENTION_DAYS=90
JOURNAL_STREAM=8:21489
RUNNER_WORKSPACE=/home/runner/work/repository-audit
LEIN_HOME=/usr/local/lib/lein
LEIN_JAR=/usr/local/lib/lein/self-installs/leiningen-2.9.7-standalone.jar
GITHUB_ACTION_REPOSITORY=
PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/runner/.local/bin:/opt/pipx_bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
RUNNER_PERFLOG=/home/runner/perflog
GITHUB_BASE_REF=
CI=true
SWIFT_PATH=/usr/share/swift/usr/bin
ImageOS=ubuntu20
GITHUB_REPOSITORY_OWNER=ably
GITHUB_HEAD_REF=
GITHUB_ACTION_REF=
GITHUB_WORKFLOW=.github/workflows/check.yml
DEBIAN_FRONTEND=noninteractive
GOROOT_1_15_X64=/opt/hostedtoolcache/go/1.15.15/x64
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
GOROOT_1_16_X64=/opt/hostedtoolcache/go/1.16.8/x64
_=/usr/bin/env