Skip to content

Commit

Permalink
Try auto approve from codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
Sella-GH committed May 18, 2024
1 parent c90ffde commit 59160ba
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
permissions:
# required for all workflows
security-events: write
pull-requests: write

# only required for workflows in private repositories
actions: read
Expand Down Expand Up @@ -87,3 +88,21 @@ jobs:
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

- name: Check CodeQL Results
if: ${{ github.event.name == 'pull_request' }}
id: check_codeql
run: |
if [ -f /home/runner/work/AzzyBot/results/csharp.sarif ]; then
RESULTS=$(jq '.runs[].results | length' /home/runner/work/AzzyBot/results/csharp.sarif)
echo "results=$RESULTS" >> "$GITHUB_OUTPUT"
else
echo "results=0" >> "$GITHUB_OUTPUT"
fi
- name:
if: ${{ steps.check_codeql.outputs.results == '0' && github.event.name == 'pull_request' }}
run: |
gh pr review ${{ github.event.pull_request.number }} --approve
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 59160ba

Please sign in to comment.