chore(deps): update jaegertracing/all-in-one docker tag to v1.65.0 #432
This file contains 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: Trivy Scan | |
on: | |
push: | |
schedule: | |
- cron: '0 0 * * 1' | |
permissions: | |
contents: read | |
jobs: | |
prepare: | |
name: Prepare list of images to build | |
runs-on: ubuntu-latest | |
outputs: | |
images: ${{ steps.set-matrix.outputs.images }} | |
steps: | |
- name: Check out the source code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set matrix | |
id: set-matrix | |
run: echo images="$(jq '."x-build"' images/src/*/.devcontainer.json | jq --slurp -c .)" >> "${GITHUB_OUTPUT}" | |
scan-image: | |
needs: prepare | |
name: 'Build and Scan: ${{ matrix.image.name }}' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
image: ${{ fromJson(needs.prepare.outputs.images) }} | |
steps: | |
- name: Check out the source code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Check changed files | |
id: changes | |
run: | | |
if [ "${{ github.event_name }}" = "push" ]; then | |
base="${{ github.event.before }}" | |
head="${{ github.event.after }}" | |
image="images/src/${{ matrix.image.image-name }}" | |
changes="$(git diff --name-only "${base}" "${head}" -- "${image}" | grep -Fv "${image}/README.md" || true)" | |
if [ -n "${changes}" ]; then | |
echo needs_build=true >> "${GITHUB_OUTPUT}" | |
else | |
echo needs_build=false >> "${GITHUB_OUTPUT}" | |
fi | |
else | |
echo needs_build=true >> "${GITHUB_OUTPUT}" | |
fi | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | |
if: steps.changes.outputs.needs_build == 'true' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
if: steps.changes.outputs.needs_build == 'true' | |
- name: Install @devcontainers/cli | |
run: npm install -g @devcontainers/cli | |
if: steps.changes.outputs.needs_build == 'true' | |
- name: Build image | |
run: devcontainer build --workspace-folder "images/src/${{ matrix.image.image-name }}" --image-name ${{ matrix.image.image-name }} | |
if: steps.changes.outputs.needs_build == 'true' | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.29.0 | |
if: ${{ steps.changes.outputs.needs_build == 'true' && github.event.sender.login != 'dependabot[bot]' }} | |
with: | |
image-ref: '${{ matrix.image.image-name }}:latest' | |
format: sarif | |
output: trivy-${{ matrix.image.image-name }}.sarif | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 | |
if: ${{ steps.changes.outputs.needs_build == 'true' && github.event.sender.login != 'dependabot[bot]' }} | |
with: | |
sarif_file: trivy-${{ matrix.image.image-name }}.sarif | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.29.0 | |
if: steps.changes.outputs.needs_build == 'true' | |
with: | |
image-ref: '${{ matrix.image.image-name }}:latest' | |
format: table |