Skip to content

feat: set RUNNER_ENVIRONMENT and runner.environment like GitHub - #1

Merged
zackees merged 2 commits into
masterfrom
feat/runner-environment
Oct 2, 2026
Merged

zackees merged 2 commits into
masterfrom
feat/runner-environment

Conversation

@zackees

@zackees zackees commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Upstream act sets RUNNER_OS/RUNNER_ARCH/RUNNER_TEMP/RUNNER_TOOL_CACHE but no RUNNER_ENVIRONMENT, so actions whose defaults key on it (e.g. astral-sh/setup-uv's enable-cache: auto, which caches only on GitHub-hosted runners) behave as if on an unknown runner, and repositories carried per-step overrides for local runs.

  • runner.environment: github-hosted for a job container (act's runner images emulate GitHub-hosted runners), self-hosted for -self-hosted host mode.
  • RUNNER_ENVIRONMENT: set for a job container unless the workflow or --env sets it; host mode copies it from the runner context like the other RUNNER_* variables.

Tests (RED -> GREEN)

  • testdata/runner-environment/hosted in TestRunEvent (default + explicit-override jobs) and testdata/runner-environment/self-hosted in TestRunEventHostEnvironment: both fail without the change (Job 'default' failed) and pass with it (run locally in golang:1.25 with the Docker socket).
  • TestSetRunnerEnvironment, TestRunnerContextEnvironment unit tests.

Implements criterion 6 of ACT-002 (forge-ci/ci.yml#213, policy merged in forge-ci/ci.yml#217). Coordinated with zackees/clud (local CI migration to bosn → act2) and zackees/bosn (act2 pin).

zackees and others added 2 commits October 2, 2026 14:44
Upstream act sets RUNNER_OS/ARCH/TEMP/TOOL_CACHE but no RUNNER_ENVIRONMENT,
so every action whose default keys on it (setup-uv's enable-cache: auto
caches only on GitHub-hosted runners) behaves as if on an unknown runner,
and repositories carried per-step overrides for local runs.

- runner.environment: github-hosted for a job container (act's runner
  images emulate GitHub-hosted runners), self-hosted for -self-hosted host
  mode.
- RUNNER_ENVIRONMENT: set for a job container unless the workflow or --env
  sets it; host mode copies it from the runner context like the other
  RUNNER_* variables.

Tests: testdata/runner-environment/{hosted,self-hosted} in TestRunEvent and
TestRunEventHostEnvironment (RED without the change), plus unit tests.

Implements criterion 6 of zackees/ci.yml ACT-002 (forge-ci/ci.yml#213, nektos#217).

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant