From 4b9a75c3baa788f9b1bea241881b20ef9c1e47ea Mon Sep 17 00:00:00 2001 From: Jakub Sliacan Date: Mon, 4 Dec 2023 20:49:58 +0100 Subject: [PATCH] gha: add gh-context job to installer workflow We want to keep track of something unique to the trigger-event (that is the same across all actions triggered by that event that particular time). Given that an event triggered a chain of workflows, first workflow in the chain can access the trigger event, but later workflows can't. Saving something like shared commit-sha (correlation-id of sorts) as artifact will help us keep track of that. This information is contained in github context, so we save the whole json. --- .github/workflows/windows-installer.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/windows-installer.yml b/.github/workflows/windows-installer.yml index 000aee873a..fbf38fd1d3 100644 --- a/.github/workflows/windows-installer.yml +++ b/.github/workflows/windows-installer.yml @@ -4,7 +4,27 @@ on: branches: - "main" pull_request: {} + jobs: + save-gh-context: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + + - name: Save the GH context in an artifact + shell: bash + env: + GH_CONTEXT: ${{ toJSON(github) }} + run: echo $GH_CONTEXT > gh_context.json + + - name: Upload the GH context artifact + uses: actions/upload-artifact@v3 + with: + name: gh_context + path: ./gh_context.json + build: runs-on: ${{ matrix.os }} strategy: