From 7c3eec0656a1093aa59564451e2e79848dca4d04 Mon Sep 17 00:00:00 2001 From: Graham Savage Date: Tue, 19 May 2026 16:44:35 +0100 Subject: [PATCH] Expose Kosli flow and trail as outputs from apply.yml Reusable workflows can declare outputs via on.workflow_call.outputs. Surface kosli_flow and kosli_trail so callers can do follow-up work on the same trail (e.g. extra attestations) without having to recompute the names from inputs and github context. The values are emitted from a small step in reset-drift-detection that echoes the existing KOSLI_FLOW / KOSLI_TRAIL env vars to GITHUB_OUTPUT, so the strings stay defined in a single place. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/apply.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index baedcf9..9d78133 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -42,6 +42,13 @@ on: kosli_api_token: description: "Kosli API token. Required when kosli_template_file is set." required: false + outputs: + kosli_flow: + description: "Name of the Kosli flow used by this workflow." + value: ${{ jobs.reset-drift-detection.outputs.kosli_flow }} + kosli_trail: + description: "Name of the Kosli trail used by this workflow." + value: ${{ jobs.reset-drift-detection.outputs.kosli_trail }} jobs: apply: @@ -77,7 +84,16 @@ jobs: KOSLI_API_TOKEN: ${{ secrets.kosli_api_token }} KOSLI_FLOW: terraform-apply-${{ inputs.environment }}-${{ github.event.repository.name }} KOSLI_TRAIL: ${{ github.event.pull_request.head.sha || github.sha }} + outputs: + kosli_flow: ${{ steps.kosli_names.outputs.kosli_flow }} + kosli_trail: ${{ steps.kosli_names.outputs.kosli_trail }} steps: + - name: Expose Kosli flow and trail + id: kosli_names + run: | + echo "kosli_flow=${KOSLI_FLOW}" >> "$GITHUB_OUTPUT" + echo "kosli_trail=${KOSLI_TRAIL}" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Configure AWS credentials