Skip to content

Commit ee5c7ff

Browse files
committed
testing artifact name with PR number
Signed-off-by: rostalan <rlan@redhat.com>
1 parent da3aca8 commit ee5c7ff

2 files changed

Lines changed: 10 additions & 16 deletions

File tree

.github/workflows/pr-actions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
- name: Upload published-exports artifact
233233
uses: actions/upload-artifact@v4
234234
with:
235-
name: published-exports
235+
name: published-exports-pr-${{ needs.prepare.outputs.pr-number }}
236236
path: published-exports/
237237
if-no-files-found: error
238238
retention-days: 7

.github/workflows/workspace-tests.yaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -57,14 +57,8 @@ jobs:
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

Comments
 (0)