name: "CodeQL with bleeding edge queries and extractor" on: workflow_dispatch: push: branches: [ main ] pull_request: # The branches below must be a subset of the branches above branches: [ main ] schedule: - cron: '21 18 * * 5' jobs: build: uses: github/codeql-ql/.github/workflows/build.yml@main with: os: '[ "ubuntu-latest" ]' analyze: name: Analyze needs: - build runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write steps: - name: Download pack uses: actions/download-artifact@v2 with: name: codeql-ql-pack path: ${{ runner.temp }}/codeql-ql-pack-artifact - name: Prepare pack run: | unzip "${PACK_ARTIFACT}/*.zip" -d "${PACK}" env: PACK_ARTIFACT: ${{ runner.temp }}/codeql-ql-pack-artifact PACK: ${{ runner.temp }}/pack - name: Hack codeql-action options run: | JSON=$(jq -nc --arg pack "${PACK}" '.resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]') echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV} env: PACK: ${{ runner.temp }}/pack - name: Checkout repository uses: actions/checkout@v2 - name: Initialize CodeQL uses: github/codeql-action/init@esbena/ql with: languages: ql db-location: ${{ runner.temp }}/db - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@esbena/ql - name: Upload db uses: actions/upload-artifact@v2 with: name: db path: ${{ runner.temp }}/db retention-days: 1