CodeQL Auto Language #556
This file contains hidden or 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 Auto Language" | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '17 19 * * 6' | |
jobs: | |
create-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.languages }} | |
steps: | |
- name: Get languages from repo | |
id: set-matrix | |
uses: advanced-security/set-codeql-language-matrix@v1 | |
with: | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
endpoint: ${{ github.event.repository.languages_url }} | |
analyze: | |
needs: create-matrix | |
if: ${{ needs.create-matrix.outputs.matrix != '[]' }} | |
name: Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Initializes the CodeQL tools for scanning. | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Set up dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '9.0.*' | |
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v3 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{matrix.language}}" |