This repository was archived by the owner on Dec 12, 2025. It is now read-only.
CodeQL #205
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 | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| schedule: | |
| - cron: '36 5 * * 4' | |
| jobs: | |
| analyze: | |
| name: Analyze | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | |
| language: [ 'java' ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | |
| # queries: security-extended,security-and-quality | |
| with: | |
| languages: ${{ matrix.language }} | |
| queries: security-extended | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: current | |
| - name: Gradle Build and Publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gradle build cyclonedxBom -x test \ | |
| -DGITHUB_REPOSITORY=${{ github.repository }} \ | |
| -DGITHUB_ACTOR=${{ github.actor }} \ | |
| -DGITHUB_TOKEN=$GITHUB_TOKEN | |
| # ℹ️ Command-line programs to run using the OS shell. | |
| # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | |
| # If the (auto)build fails above, remove it and uncomment the following three lines. | |
| # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: "/language:${{matrix.language}}" | |
| - name: Log generated SBOM Hash | |
| run: sha256sum build/reports/bom.json || true | |
| # This ensures: | |
| # - The SBOM is archived with the CodeQL scan output | |
| # - It's available to download and inspect from the GitHub Actions UI | |
| - name: Upload SBOM | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sbom | |
| path: build/reports/bom.json |