File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Query help preview
2+
3+ on :
4+ pull_request :
5+ branches : [main]
6+ paths :
7+ - " **/*.qhelp"
8+
9+ jobs :
10+ qhelp :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v2
14+ with :
15+ fetch-depth : 2
16+ - name : Determine changed files
17+ id : changes
18+ run : |
19+ echo -n "::set-output name=qhelp_files::"
20+ (git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep .qhelp$ | grep -v .inc.qhelp;
21+ 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) |
22+ sort -u | xargs -d '\n' -n1 printf "'%s' "
23+
24+ - name : Fetch CodeQL
25+ run : |
26+ LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | tail -1)
27+ gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST"
28+ unzip -q codeql-linux64.zip
29+ env :
30+ GITHUB_TOKEN : ${{ github.token }}
31+ - name : QHelp preview
32+ if : ${{ steps.changes.outputs.qhelp_files }}
33+ run : |
34+ ( echo "QHelp previews:";
35+ for path in ${{ steps.changes.outputs.qhelp_files }} ; do
36+ echo "<details> <summary>${path}</summary>"
37+ echo
38+ codeql/codeql generate query-help --format=markdown ${path}
39+ echo "</details>"
40+ done) | gh pr comment "${{ github.event.pull_request.number }}" -F -
41+ env :
42+ GITHUB_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments