mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Split workflow into separate jobs
This commit is contained in:
35
.github/workflows/qhelp-pr-preview.yml
vendored
35
.github/workflows/qhelp-pr-preview.yml
vendored
@@ -2,7 +2,6 @@ name: Query help preview
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
@@ -14,6 +13,8 @@ on:
|
||||
|
||||
jobs:
|
||||
qhelp:
|
||||
permissions:
|
||||
contents: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: github/codeql/.github/actions/fetch-codeql@main
|
||||
@@ -32,14 +33,28 @@ jobs:
|
||||
|
||||
- name: QHelp preview
|
||||
run: |
|
||||
if [ -s "${{ runner.temp }}/paths.txt" ]; then
|
||||
( echo "QHelp previews:";
|
||||
cat "${{ runner.temp }}/paths.txt" | while read path; do
|
||||
echo "<details> <summary>${path}</summary>"
|
||||
echo
|
||||
codeql generate query-help --format=markdown "${path}"
|
||||
echo "</details>"
|
||||
done) | gh pr comment "${{ github.event.pull_request.number }}" -F -
|
||||
fi
|
||||
cat "${{ runner.temp }}/paths.txt" | while read path; do
|
||||
echo "<details> <summary>${path}</summary>"
|
||||
echo
|
||||
codeql generate query-help --format=markdown "${path}"
|
||||
echo "</details>"
|
||||
done > comment.txt
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: comment.txt
|
||||
path: comment.txt
|
||||
|
||||
post_comment:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
needs: qhelp
|
||||
steps:
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: comment.txt
|
||||
- run: |
|
||||
(echo "QHelp previews:"; cat comment.txt) | gh pr comment "${{ github.event.pull_request.number }}" --repo "${{ github.repository }}" -F -
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
Reference in New Issue
Block a user