-
Notifications
You must be signed in to change notification settings - Fork 2.1k
43 lines (39 loc) · 1.32 KB
/
run_test_cases_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
name: run test cases PR comment
on:
workflow_run:
workflows: ["run test cases"]
types:
- completed
permissions:
issues: write
pull-requests: write
jobs:
post-pr-comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Download artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
gh run download -R "${{ github.repository }}" --name "pr.txt" "$RUN_ID"
gh run download -R "${{ github.repository }}" --name "comment.txt" "$RUN_ID"
gh run download -R "${{ github.repository }}" --name "commentwin.txt" "$RUN_ID"
- name: Set PR environment variable
uses: actions/github-script@v4
with:
script: |
const fs = require('fs');
const pr = fs.readFileSync('pr.txt', 'utf8').trim();
core.exportVariable('PR_NUMBER', pr);
- name: Update Mac Comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.PR_NUMBER }}
body-path: 'comment.txt'
- name: Update Win Comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.PR_NUMBER }}
body-path: 'commentwin.txt'