File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 1
1
name : Query help preview
2
2
3
+ permissions :
4
+ contents : read
5
+ pull-requests : write
6
+
3
7
on :
4
- pull_request :
8
+ pull_request_target :
5
9
branches :
6
10
- main
7
- - ' rc/*'
11
+ - " rc/*"
8
12
paths :
9
13
- " ruby/**/*.qhelp"
10
14
@@ -14,25 +18,25 @@ jobs:
14
18
steps :
15
19
- uses : actions/checkout@v2
16
20
with :
21
+ ref : refs/pull/${{ github.event.number }}/merge
17
22
fetch-depth : 2
18
23
- name : Determine changed files
19
24
id : changes
20
25
run : |
21
- echo -n "::set-output name=qhelp_files::"
22
- (git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep .qhelp$ | grep -v .inc.qhelp;
23
- git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep .inc.qhelp$ | xargs -d '\n' -rn1 basename | xargs -d '\n' -rn1 git grep -l) |
24
- sort -u | xargs -d '\n' -n1 printf "'%s' "
26
+ (git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep '.qhelp$' | grep -v '.inc.qhelp';
27
+ git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep '.inc.qhelp$' | xargs -d '\n' -rn1 basename | xargs -d '\n' -rn1 git grep -l) |
28
+ sort -u > "${{ runner.temp }}/paths.txt"
25
29
26
30
- uses : ./.github/actions/fetch-codeql
27
31
28
32
- name : QHelp preview
29
33
if : ${{ steps.changes.outputs.qhelp_files }}
30
34
run : |
31
35
( echo "QHelp previews:";
32
- for path in ${{ steps.changes.outputs.qhelp_files }} ; do
36
+ cat " ${{ runner.temp }}/paths.txt" | while read path ; do
33
37
echo "<details> <summary>${path}</summary>"
34
38
echo
35
- codeql generate query-help --format=markdown ${path}
39
+ codeql generate query-help --format=markdown " ${path}"
36
40
echo "</details>"
37
41
done) | gh pr comment "${{ github.event.pull_request.number }}" -F -
38
42
env :
You can’t perform that action at this time.
0 commit comments