-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: refactor build workflows #565
Conversation
518be79
to
28884ac
Compare
Trivy Scan Reportghcr.io/automattic/vip-container-images/alpine:3.18.4 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/dev-tools:0.9 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/mu-plugins:0.1 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/nginx:1.25.2 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/skeleton:latest (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/photon:latest (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/php-fpm:7.4 (ubuntu 22.04)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/php-fpm:8.2 (ubuntu 22.04)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/php-fpm:8.1 (ubuntu 22.04)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/php-fpm:8.3 (ubuntu 22.04)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/traefik_openssl:2.10.5 (alpine 3.18.4)VulnerabilitiesNo vulnerabilities found. MisconfigurationsNo misconfigurations found. usr/local/bin/traefikVulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:5.8 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:6.1 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:5.9 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:6.2 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:6.0 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:6.3 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:trunk (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
Trivy Scan Reportghcr.io/automattic/vip-container-images/wordpress:6.4 (alpine 3.18.4)Vulnerabilities
MisconfigurationsNo misconfigurations found. |
- name: Load image to local Docker | ||
uses: docker/build-push-action@v5 | ||
with: | ||
load: true | ||
push: false | ||
context: ${{ inputs.context }} | ||
file: ${{ inputs.file }} | ||
tags: | | ||
${{ inputs.primaryTag }} | ||
${{ inputs.tags }} | ||
build-args: ${{ inputs.args }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This second scan will not rebuild the image(s); it will load them from the build cache.
We need this step to feed the built image to the local Docker daemon. The previous step pushes the built image(s) to the registry but does not load them into Docker.
It is impossible to feed a multi-platform image to Docker anyway, so we export only the native version (amd64).
- name: Security Scan | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: ${{ inputs.primaryTag }} | ||
format: template | ||
template: "@.github/actions/build-docker-image/markdown.tpl" | ||
output: trivy.md | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.event.sender.login != 'dependabot[bot]' | ||
|
||
- name: Security Scan | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: ${{ inputs.primaryTag }} | ||
format: table | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name || github.event.sender.login == 'dependabot[bot]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot post a comment from a PR coming from a "foreign" repo; Dependabot's pull requests also count as coming from a foreign repo.
So:
- If this is a PR that comes from our repo and not from Dependabot, we generate a markdown output, which we will post as a comment;
- Otherwise, if this is not a pull request, a PR from a foreign repo, or Dependabot authors this PR, we print scan results to the action log.
25531f8
to
e7f7291
Compare
Trivy Scan Reportghcr.io/automattic/vip-container-images/nginx:1.25.3 (alpine 3.18.4)VulnerabilitiesNo vulnerabilities found. MisconfigurationsNo misconfigurations found. |
Supersedes: #563
Supersedes: #239