Skip to content

Commit 82ea1af

Browse files
Jakub Sliacanadrianriobo
Jakub Sliacan
authored andcommitted
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.
1 parent 5a8b08a commit 82ea1af

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: .github/workflows/windows-installer.yml

+20
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@ on:
44
branches:
55
- "main"
66
pull_request: {}
7+
78
jobs:
9+
save-gh-context:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
14+
steps:
15+
16+
- name: Save the GH context in an artifact
17+
shell: bash
18+
env:
19+
GH_CONTEXT: ${{ toJSON(github) }}
20+
run: echo $GH_CONTEXT > gh_context.json
21+
22+
- name: Upload the GH context artifact
23+
uses: actions/upload-artifact@v3
24+
with:
25+
name: gh_context
26+
path: ./gh_context.json
27+
828
build:
929
runs-on: ${{ matrix.os }}
1030
strategy:

0 commit comments

Comments
 (0)