-
Notifications
You must be signed in to change notification settings - Fork 310
54 lines (47 loc) · 1.59 KB
/
eval-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
53
54
# Post evaluation results from the "Evaluate" workflow as a PR comment
name: Post Eval Metrics
on:
# Runs with read & write privilages for the GITHUB_TOKEN
workflow_run:
workflows: ["Evaluate"]
types:
- completed
jobs:
comment-eval-results:
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
actions: read # for downloading artifacts
pull-requests: write # for posting PR comment
steps:
- name: Download Eval Metrics
uses: actions/download-artifact@v4
with:
name: eval-metrics
path: eval-metrics-artifact/
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Display structure of downloaded files
run: ls -R
- name: Read CSV
id: csv
uses: juliangruber/read-file-action@v1
with:
path: eval-metrics-artifact/eval-ci-metrics.csv
- name: Create Markdown Table
uses: petems/csv-to-md-table-action@master
id: csv-table-output
with:
csvinput: ${{ steps.csv.outputs.content }}
- name: Post Table as a Comment
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
issue-number: ${{ github.event.pull_request.number }}
body: |
### Evaluation Metrics
${{steps.csv-table-output.outputs.markdown-table}}
reactions: rocket