-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (36 loc) · 1.3 KB
/
code_coverage_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
name: Code Coverage PR Comment
on:
workflow_run:
workflows: [Build SketchNow]
types:
- completed
defaults:
run:
shell: pwsh
# This is required by marocchino/sticky-pull-request-comment
# You must enable read/write permissions to allow workflows to create comments on the PR.
# On your repo navigate to: Settings > Actions > General > Workflow permissions, and make sure to enable read and write permissions.
# https://github.com/marocchino/sticky-pull-request-comment#error-resource-not-accessible-by-integration
permissions:
pull-requests: write
jobs:
post-code-coverage:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Download artifacts
run: gh run download ${{ github.event.workflow_run.id }} -n CodeCoverage --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}
- name: 'Get PR Number'
id: get-pr-number
run: |
$pr_number = (cat PullRequestNumber)
"pr_number=$pr_number" >> $env:GITHUB_OUTPUT
- uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
number: ${{ steps.get-pr-number.outputs.pr_number }}
path: SummaryGithub.md