-
Notifications
You must be signed in to change notification settings - Fork 28
52 lines (45 loc) · 1.4 KB
/
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
49
50
51
52
name: Pull Request Comment
on:
workflow_run:
workflows: ["Benchmark Suite"]
types:
- completed
jobs:
upload:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/download-artifact@v3
with:
name: pr
path: ./var/phpbench/pr-id.txt
- name: save PR id
id: pr
run: |
echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v3
with:
name: phpbench
path: ./var/phpbench/summary.txt
- name: Get Benchmarks Output
id: get-benchmarks
run: |
echo "content<<EOF" >> $GITHUB_OUTPUT
echo "$(cat ./var/phpbench/summary.txt)" >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
- name: "Find Comment"
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ steps.pr.outputs.id }}
comment-author: 'github-actions[bot]'
body-includes: '# Flow PHP - Benchmarks'
- name: "Create or update comment"
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ steps.pr.outputs.id }}
body: ${{ steps.get-benchmarks.outputs.content }}
edit-mode: replace