Skip to content

Commit 0eae89a

Browse files
authored
Merge pull request #228 from github/qhelp
QHelp preview
2 parents 5afd3c7 + 48ad0aa commit 0eae89a

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/qhelp.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 }}

0 commit comments

Comments
 (0)