mirror of
https://github.com/github/codeql.git
synced 2026-04-08 08:34:02 +02:00
43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
name: Query help preview
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "**/*.qhelp"
|
|
|
|
jobs:
|
|
qhelp:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Determine changed files
|
|
id: changes
|
|
run: |
|
|
echo -n "::set-output name=qhelp_files::"
|
|
(git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep .qhelp$ | grep -v .inc.qhelp;
|
|
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) |
|
|
sort -u | xargs -d '\n' -n1 printf "'%s' "
|
|
|
|
- name: Fetch CodeQL
|
|
run: |
|
|
LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | grep -v beta | sort --version-sort | tail -1)
|
|
gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST"
|
|
unzip -q codeql-linux64.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
- name: QHelp preview
|
|
if: ${{ steps.changes.outputs.qhelp_files }}
|
|
run: |
|
|
( echo "QHelp previews:";
|
|
for path in ${{ steps.changes.outputs.qhelp_files }} ; do
|
|
echo "<details> <summary>${path}</summary>"
|
|
echo
|
|
codeql/codeql generate query-help --format=markdown ${path}
|
|
echo "</details>"
|
|
done) | gh pr comment "${{ github.event.pull_request.number }}" -F -
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|