generated from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (54 loc) · 1.89 KB
/
comment-e2e-test.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
55
56
57
name: E2E Report on Pull Request Comment
on:
workflow_run:
workflows: ['Meshery UI and Server']
types: [completed]
permissions:
issues: write
contents: read
pull-requests: write
jobs:
e2e-test-reporter:
runs-on: ubuntu-latest
steps:
- name: Download e2e test report artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: e2e-test-reporter
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Retrieve PR Number
run: |
echo "PULL_REQUEST=$(cat ./pr/number)" >> $GITHUB_OUTPUT
id: pr
- name: Find Comment
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
id: fc
with:
issue-number: ${{ steps.pr.outputs.PULL_REQUEST }}
comment-author: 'github-actions[bot]'
body-includes: END-TO-END TESTS
- name: Delete Previous Comment
if: steps.fc.outputs.comment-id != ''
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: ${{ steps.fc.outputs.comment-id }}
})
- name: Comment on staging url
if: ${{ !cancelled() }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const fs = require('fs')
const PRNumber = Number(fs.readFileSync('./pr/number'))
const E2ETestReporter = String(fs.readFileSync('./ui/test-report.md'))
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: PRNumber,
body: E2ETestReporter
})