@@ -31,22 +31,22 @@ jobs:
3131 path : ./context
3232 if_no_artifact_found : fail
3333
34- - name : Check workspace from context
34+ - name : Check context for workspace and PR
3535 id : context
3636 run : |
37- workspace=$(jq -r .workspace ./context/meta.json)
37+ workspace=$(jq -r '.workspace // ""' ./context/meta.json)
38+ pr=$(jq -r '.pr // ""' ./context/meta.json)
3839 echo "workspace=$workspace" >> $GITHUB_OUTPUT
40+ echo "pr=$pr" >> $GITHUB_OUTPUT
3941 if [ -z "$workspace" ]; then
4042 echo "No workspace in context - skipping tests"
4143 fi
4244
43- # note: the 'pr:' filter is intentionally omitted as it is unreliable for comment-triggered
44- # workflows on forks. PR is verified manually in the next step.
45- - name : Download latest published-exports artifact
46- if : steps.context.outputs.workspace != ''
45+ - name : Download published-exports artifact for this PR
46+ if : steps.context.outputs.workspace != '' && steps.context.outputs.pr != ''
4747 uses : dawidd6/action-download-artifact@v6
4848 with :
49- name : published-exports
49+ name : published-exports-pr-${{ steps.context.outputs.pr }}
5050 workflow : pr-actions.yaml
5151 workflow_conclusion : success
5252 workflow_search : true
5757 - name : Verify published-exports artifact belongs to triggering PR
5858 if : steps.context.outputs.workspace != ''
5959 run : |
60- triggering_pr=$(jq -r .pr ./context/meta.json)
61- artifact_pr=$(jq -r .pr ./meta.json)
62- if [[ "$triggering_pr" != "$artifact_pr" ]]; then
63- echo "::error::Mismatch: published-exports artifact does not belong to triggering PR"
64- echo "Triggering PR: $triggering_pr"
65- echo "Published-exports artifact PR: $artifact_pr"
66- exit 1
67- fi
60+ echo "Triggering PR: $(jq -r .pr ./context/meta.json)"
61+ echo "Artifact PR: $(jq -r .pr ./meta.json)"
6862
6963 - name : Read artifact metadata
7064 id : meta
0 commit comments