File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ name: Query help preview
22
33permissions :
44 contents : read
5- pull-requests : write
65
76on :
87 pull_request_target :
1413
1514jobs :
1615 qhelp :
16+ permissions :
17+ contents : read
1718 runs-on : ubuntu-latest
1819 steps :
1920 - uses : github/codeql/.github/actions/fetch-codeql@main
@@ -32,14 +33,28 @@ jobs:
3233
3334 - name : QHelp preview
3435 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 -
4459 env:
4560 GITHUB_TOKEN: ${{ github.token }}
You can’t perform that action at this time.
0 commit comments