Skip to content

Commit 02efab5

Browse files
committed
update pr ci
1 parent 3d60faf commit 02efab5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/pr.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
env:
77
TEST_TIMEOUT: 5m
88
EXAMPLE_TIMEOUT: 5m
9-
BRANCH: ${{ startsWith(github.head_ref, '') && github.head_ref || github.ref_name }}
9+
BRANCH: ${{ startsWith(github.head_ref, '') && github.head_ref || github.ref_name }}
1010

1111
jobs:
1212
test:
@@ -69,6 +69,24 @@ jobs:
6969
- name: Upload assets
7070
uses: actions/upload-artifact@v4
7171
with:
72-
name: ${{ env.BRANCH }}-assets
72+
name: "${{ env.BRANCH }}-assets"
7373
path: |
7474
*.gif
75+
76+
# Optional: Add PR annotation with link to artifact
77+
- name: Comment artifact download link
78+
if: ${{ github.event_name == 'pull_request' }}
79+
run: |
80+
echo "::set-output name=comment::Download the latest artifact [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
81+
id: artifact-link
82+
- name: Post artifact link to PR
83+
if: ${{ github.event_name == 'pull_request' }}
84+
uses: actions/github-script@v6
85+
with:
86+
script: |
87+
github.issues.createComment({
88+
issue_number: ${{ github.event.pull_request.number }},
89+
owner: context.repo.owner,
90+
repo: context.repo.repo,
91+
body: steps.artifact-link.outputs.comment
92+
})

0 commit comments

Comments
 (0)