-
Notifications
You must be signed in to change notification settings - Fork 27
47 lines (41 loc) · 1.38 KB
/
leave-comment.yml
File metadata and controls
47 lines (41 loc) · 1.38 KB
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
name: Leave a comment
on:
workflow_run:
workflows: ['Generate and Compare Docs']
types: [completed]
permissions:
contents: read
actions: read
pull-requests: write
jobs:
aggregate:
name: Aggregate Comparison Results
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Download all comparison artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: results
- name: Combine results
id: combine
# Even if the cat fails (no files found), we don't want to fail the workflow
continue-on-error: true
run: |
{
echo "combined<<EOF"
cat results/*/comparison.txt
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Add Comment to PR
if: steps.combine.outputs.combined
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
with:
comment-tag: compared
message: ${{ steps.combine.outputs.combined }}
pr-number: ${{ github.event.workflow_run.pull_requests[0].number }}