Split workflow into separate jobs

This commit is contained in:
Arthur Baars
2021-10-27 18:56:44 +02:00
parent aeedfd9987
commit 5e2cab4fb1

View File

@@ -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 }}