Skip to content

Commit bbfd8e7

Browse files
committed
I've got a sinking feeling
1 parent c6d8b4e commit bbfd8e7

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/workflow_run_sink.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ jobs:
1111
- run: cat <<< "$heck"
1212
env:
1313
heck: ${{toJSON(github.event)}}
14+
# I was wondering why this example here uses actions/github-scripts
15+
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#using-data-from-the-triggering-workflow
16+
# And it turns out that stupid download-artifact ignores the run-id unless you explicitly provide a token
17+
# https://github.com/actions/download-artifact/blob/d3f86a106a0bac45b974a628896c90dbdf5c8093/src/download-artifact.ts#L53
18+
# We can just manually specify our token though, the documentation of download-artifact says it defaults to the run token but it doesn't actually
1419
- uses: actions/download-artifact@v4
1520
with:
1621
run-id: ${{github.event.workflow_run.id}}
1722
name: test-artifact
23+
github-token: ${{github.token}}
1824
- run: cat output.txt

.github/workflows/workflow_run_source.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_run
2+
# There is unfortunately not any sort of feedback on the source workflow that a sink workflow was triggered or what its status is.
3+
# The sink will be marked as having been triggered by whoever triggered this workflow, but it does not show the orginal tirgger reason (IE: push to `main2`)
4+
# It also doesn't give you a link back to the triggering workflow or anything either, which is pretty lame.
25
name: workflow_run source
36
on:
47
push:

0 commit comments

Comments
 (0)