Merge pull request #79 from living-ip/codex/gcp-iap-workflow-runtime-fix
Some checks are pending
CI / lint-and-test (push) Waiting to run

Fix GCP operator runner path initialization
This commit is contained in:
twentyOne2x 2026-07-12 05:23:02 +02:00 committed by GitHub
commit fe8e3bd9a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 2 deletions

View file

@ -36,8 +36,6 @@ env:
CLONE_SERVICE_ACCOUNT: sa-teleo-iap-clone-operator@teleo-501523.iam.gserviceaccount.com
EXPECTED_WORKFLOW_REF: living-ip/teleo-infrastructure/.github/workflows/gcp-iap-operator.yml@refs/heads/main
DISPATCHER_VERSION: teleo-gcp-iap-operator-v1
BUNDLE_DIR: ${{ runner.temp }}/gcp-iap-operator-bundle
RESULT_DIR: ${{ runner.temp }}/gcp-iap-operator-result
jobs:
operate:
@ -48,6 +46,15 @@ jobs:
- name: Check out the dispatched main revision
uses: actions/checkout@v4
- name: Initialize runner-local paths
id: paths
shell: bash
run: |
set -euo pipefail
[[ -n "${RUNNER_TEMP:-}" ]] || exit 2
printf 'BUNDLE_DIR=%s\n' "${RUNNER_TEMP}/gcp-iap-operator-bundle" >> "${GITHUB_ENV}"
printf 'RESULT_DIR=%s\n' "${RUNNER_TEMP}/gcp-iap-operator-result" >> "${GITHUB_ENV}"
- name: Validate fixed inputs and select identity
id: validate
shell: bash

View file

@ -139,6 +139,20 @@ def test_workflow_uses_wif_official_actions_and_sanitized_short_retention() -> N
assert validate_index < auth_index
def test_workflow_initializes_runner_paths_at_step_runtime() -> None:
workflow = load_workflow()
assert "BUNDLE_DIR" not in workflow["env"]
assert "RESULT_DIR" not in workflow["env"]
steps = workflow["jobs"]["operate"]["steps"]
paths_index = next(i for i, step in enumerate(steps) if step.get("id") == "paths")
validate_index = next(i for i, step in enumerate(steps) if step.get("id") == "validate")
paths_source = steps[paths_index]["run"]
assert paths_index < validate_index
assert '"${RUNNER_TEMP}/gcp-iap-operator-bundle" >> "${GITHUB_ENV}"' in paths_source
assert '"${RUNNER_TEMP}/gcp-iap-operator-result" >> "${GITHUB_ENV}"' in paths_source
assert "runner.temp" not in WORKFLOW.read_text(encoding="utf-8")
def test_workflow_builds_exact_main_bundle_from_tracked_files_and_hashes() -> None:
source = WORKFLOW.read_text(encoding="utf-8")