File tree Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ name: Query help preview
2
2
3
3
permissions :
4
4
contents : read
5
- pull-requests : write
6
5
7
6
on :
8
7
pull_request_target :
14
13
15
14
jobs :
16
15
qhelp :
16
+ permissions :
17
+ contents : read
17
18
runs-on : ubuntu-latest
18
19
steps :
19
20
- uses : github/codeql/.github/actions/fetch-codeql@main
@@ -32,14 +33,28 @@ jobs:
32
33
33
34
- name : QHelp preview
34
35
run : |
35
- if [ -s "${{ runner.temp }}/paths.txt" ]; then
36
- ( echo "QHelp previews:";
37
- cat "${{ runner.temp }}/paths.txt" | while read path; do
38
- echo "<details> <summary>${path}</summary>"
39
- echo
40
- codeql generate query-help --format=markdown "${path}"
41
- echo "</details>"
42
- done) | gh pr comment "${{ github.event.pull_request.number }}" -F -
43
- fi
36
+ cat "${{ runner.temp }}/paths.txt" | while read path; do
37
+ echo "<details> <summary>${path}</summary>"
38
+ echo
39
+ codeql generate query-help --format=markdown "${path}"
40
+ echo "</details>"
41
+ done > comment.txt
42
+
43
+ - uses : actions/upload-artifact@v2
44
+ with :
45
+ name : comment.txt
46
+ path : comment.txt
47
+
48
+ post_comment :
49
+ permissions :
50
+ pull-requests : write
51
+ runs-on : ubuntu-latest
52
+ needs : qhelp
53
+ steps :
54
+ - uses : actions/download-artifact@v2
55
+ with :
56
+ name : comment.txt
57
+ - run : |
58
+ (echo "QHelp previews:"; cat comment.txt) | gh pr comment "${{ github.event.pull_request.number }}" --repo "${{ github.repository }}" -F -
44
59
env:
45
60
GITHUB_TOKEN: ${{ github.token }}
You can’t perform that action at this time.
0 commit comments