codeql-wrapper-monorepo #10
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
| # Workflow for scanning code with CodeQL | |
| name: codeql-wrapper-monorepo | |
| # Trigger workflow | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| use_json: | |
| description: 'Use .codeql.yml configuration file?' | |
| required: true | |
| type: boolean | |
| default: true | |
| test_mode: | |
| description: 'Run in test mode?' | |
| required: true | |
| type: boolean | |
| default: true | |
| jobs: | |
| codeql-analysis: | |
| name: codeql-wrapper-monorepo | |
| runs-on: ubuntu-latest | |
| permissions: | |
| security-events: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Remove .codeql.json | |
| if: ${{ github.event.inputs.use_json == 'false' }} | |
| run: rm -f .codeql.json | |
| - name: Install Python | |
| run: | | |
| chmod +x ./install_python.sh | |
| ./install_python.sh | |
| # https://test.pypi.org/project/codeql-wrapper/ | |
| - name: Install CodeQL Wrapper (test mode) | |
| if: ${{ github.event.inputs.test_mode == 'true' }} | |
| run: | | |
| pip install -i https://test.pypi.org/simple/ codeql-wrapper | |
| codeql-wrapper --version | |
| # https://pypi.org/project/codeql-wrapper/ | |
| - name: Install CodeQL Wrapper (production mode) | |
| if: ${{ github.event.inputs.test_mode == 'false' }} | |
| run: | | |
| pip install codeql-wrapper | |
| codeql-wrapper --version | |
| - name: Run CodeQL Analysis | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT }} | |
| run: | | |
| codeql-wrapper --verbose analyze ./monorepo --monorepo --upload-sarif |