ci(codeql): fetch all changes #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CodeQL | |
on: | |
push: | |
branches: [main] | |
jobs: | |
analyze: | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
actions: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check for non-Dependabot commits | |
run: | | |
git fetch origin "${{ github.event.before }}..${{ github.sha }}" | |
if git log --format='%an' ${{ github.event.before }}..${{ github.sha }} | grep "dependabot\[bot\]" &> /dev/null; then | |
echo "Non-Dependabot commits found. Workflow can continue." | |
exit 0 | |
fi | |
echo "Only Dependabot commits found." | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
- name: Perform analysis | |
uses: github/codeql-action/analyze@v2 |