forked from Perfect-Abstractions/Compose
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.24 KB
/
coverage-comment.yml
File metadata and controls
40 lines (35 loc) · 1.24 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
name: Post Coverage Comment
on:
workflow_run:
workflows: ["Coverage"]
types:
- completed
permissions:
actions: read
pull-requests: write
issues: write
contents: read
jobs:
comment:
name: Post Coverage Comment
runs-on: ubuntu-latest
# Only run if the workflow run was for a pull request
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Check workflow run status
run: |
echo "Workflow run conclusion: ${{ github.event.workflow_run.conclusion }}"
echo "Workflow run event: ${{ github.event.workflow_run.event }}"
echo "Workflow run ID: ${{ github.event.workflow_run.id }}"
echo "Head branch: ${{ github.event.workflow_run.head_branch }}"
- name: Checkout repository
if: github.event.workflow_run.conclusion == 'success'
uses: actions/checkout@v4
- name: Download and post coverage comment
if: github.event.workflow_run.conclusion == 'success'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/scripts/post-coverage-comment.js');
await script({ github, context });