-
Notifications
You must be signed in to change notification settings - Fork 70
45 lines (40 loc) · 1.41 KB
/
post-review.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
name: Post clang-tidy review comments
on:
workflow_run:
workflows: ["Codestyle"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
# Downloads the artifact uploaded by the lint action
- name: 'Download artifact'
uses: actions/github-script@v6
with:
script: |
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "clang-tidy-review"
})[0];
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
const fs = require('fs');
fs.writeFileSync('${{github.workspace}}/clang-tidy-review.zip', Buffer.from(download.data));
- name: 'Unzip artifact'
run: unzip clang-tidy-review.zip
- uses: ZedThree/clang-tidy-review/[email protected]
id: post
with:
lgtm_comment_body: ''
# If there are any comments, fail the check
- if: steps.post.outputs.total_comments > 0
run: exit 1