Workflow file for this run
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: Central repo for running language checks | |
| on: | |
| push: | |
| jobs: | |
| get-scan-languages: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/github-script@v8 | |
| id: set-repo-languages | |
| with: | |
| script: | | |
| return ['Python', 'Dockerfile'] | |
| let { data } = await github.rest.repos.listLanguages({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| }); | |
| return Object.keys(data) | |
| outputs: | |
| languages: ${{ steps.set-repo-languages.outputs.result }} | |
| run-python-scan: | |
| if: ${{contains(fromJSON(needs.get-scan-languages.outputs.languages), 'Python') }} | |
| needs: [get-scan-languages] | |
| permissions: | |
| contents: read | |
| security-events: write | |
| issues: write | |
| pull-requests: write | |
| actions: read | |
| uses: ./.github/workflows/org.python-ci.yml | |
| run-docker-scan: | |
| if: ${{contains(fromJSON(needs.get-scan-languages.outputs.languages), 'Docker') }} | |
| needs: [get-scan-languages] | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/org.docker-ci.yml | |
| run-terraform-scan: | |
| if: ${{contains(fromJSON(needs.get-scan-languages.outputs.languages), 'Terraform') }} | |
| needs: [get-scan-languages] | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/org.terraform-ci.yml | |
| # run-scan: | |
| # runs-on: ubuntu-latest | |
| # permissions: | |
| # contents: read | |
| # strategy: | |
| # matrix: | |
| # language: ${{ fromJSON(needs.get-scan-languages.outputs.languages) }} | |
| # needs: [get-scan-languages] | |
| # steps: | |
| # - name: Checkout current repo | |
| # uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| # # Ideally we would have a single task that uses the value from the matrix, however this is currently unsupported by github. | |
| # # - name: Run scan | |
| # # uses: ./.github/actions/scans/${{matrix.language}} | |
| # - name: Run Python scan | |
| # if: matrix.language == 'Python' | |
| # uses: ./.github/workflows/org.python-ci.yml | |
| # - name: Run Docker scan | |
| # if: matrix.language == 'Dockerfile' | |
| # uses: ./.github/workflows/org.docker-ci.yml | |
| # - name: Run TypeScript scan | |
| # if: matrix.language == 'Typescript' | |
| # uses: ./.github/actions/scans/typescript |