-
Notifications
You must be signed in to change notification settings - Fork 266
48 lines (44 loc) · 1.27 KB
/
test-e2e-pr-comment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: test-e2e-pr-comment
on:
workflow_run:
workflows: ['E2E Test PR']
types:
- completed
jobs:
comment:
permissions:
pull-requests: write
name: Comment User Tip
runs-on: ubuntu-latest
steps:
- name: Download Pr Artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr
if_no_artifact_found: success
- name: Save PR Id
id: pr
run: |
if [ -f pr-id.txt ]; then
echo "id=$(cat pr-id.txt)" >> $GITHUB_OUTPUT
fi
- name: Download user-tip.txt
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: user-tip
if_no_artifact_found: success
- id: txtToOutput
run: |
if [ -f user-tip.txt ]; then
echo 'text<<EOF' >> $GITHUB_OUTPUT
cat user-tip.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
- uses: thollander/actions-comment-pull-request@v2
with:
message: |
${{ steps.txtToOutput.outputs.text }}
comment_tag: e2e-tip
pr_number: ${{ steps.pr.outputs.id }}