Skip to content

Commit

Permalink
gha: add gh-context job to installer workflow
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jsliacan committed Jan 15, 2024
1 parent 01931b5 commit 4b9a75c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/windows-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4b9a75c

Please sign in to comment.