action stabilisation #46
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
| # This workflow is never used by any external repository. | |
| # It is created solely for testing purposes when developing new actions. | |
| # Feel free to change it however you want. | |
| name: "Scan containers" | |
| on: | |
| push: | |
| paths: | |
| - '.github/workflows/0-scan-containers.yaml' | |
| - 'actions/docker/scan-docker-repo/**' | |
| branches: [ 'v4-beta' ] | |
| workflow_dispatch: | |
| inputs: | |
| registry: | |
| description: | | |
| Docker registry to scan. | |
| type: string | |
| default: 'containers.pl-open.science' | |
| repository: | |
| description: | | |
| Repository to scan. | |
| type: string | |
| default: 'milaboratories/pl-containers' | |
| concurrency: | |
| description: | | |
| Number of concurrent jobs to plan. | |
| type: number | |
| default: 3 | |
| jobs: | |
| plan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: milaboratory/github-ci/actions/docker/scan-docker-repo@v4-beta | |
| id: plan | |
| with: | |
| mode: plan | |
| report-name: "skipped-images" | |
| registry: ${{ github.event.inputs.registry }} | |
| repository: ${{ github.event.inputs.repository }} | |
| concurrency: ${{ github.event.inputs.concurrency }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: 00-scanning-plan | |
| path: ${{ steps.plan.outputs.plan-dir }} | |
| outputs: | |
| plan-dir: ${{ steps.plan.outputs.plan-dir }} | |
| plan-matrix: ${{ steps.plan.outputs.plan-matrix }} | |
| scan: | |
| runs-on: ubuntu-latest | |
| name: scan ${{ matrix.plan-file }} | |
| needs: plan | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.plan.outputs.plan-matrix) }} | |
| steps: | |
| - name: Download plan | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: 00-scanning-plan | |
| path: "scan-chunks" | |
| - shell: bash | |
| run: | | |
| # Random sleep to avoid limiting on trivy side | |
| sl=$((RANDOM % 10)) | |
| sleep ${sl} | |
| - uses: milaboratory/github-ci/actions/docker/scan-docker-repo@v4-beta | |
| with: | |
| mode: scan | |
| report-name: "report-${{ matrix.plan-file }}" | |
| tag-file: scan-chunks/${{ matrix.plan-file }} | |
| limit: 2 | |
| collect: | |
| runs-on: ubuntu-latest | |
| needs: scan | |
| if: always() | |
| steps: | |
| - name: Download skipped list | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: skipped-images | |
| path: ./consolidated | |
| - name: Download all reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: 'report-*' | |
| merge-multiple: true | |
| path: ./consolidated | |
| - name: Upload consolidated report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 00-consolidated-report | |
| path: ./consolidated |