test-local #34
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: test-local | |
on: | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: 'Which version are we releasing? (format vX.Y.Z)' | |
required: false | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: "test-local" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
- name: Set up docker | |
uses: crazy-max/ghaction-setup-docker@v3 | |
with: | |
version: latest | |
daemon-config: | | |
{ | |
"experimental": true, | |
"features" : { | |
"containerd-snapshotter": true | |
} | |
} | |
- name: Get socket path | |
run: | | |
url=$(docker context inspect | jq -r .[0].Endpoints.docker.Host) | |
socket_path=$(echo "$url" | awk -F// '{print $2}') | |
echo "$socket_path" | |
echo "SOCKET=$socket_path" >> $GITHUB_ENV | |
docker_host="unix:///$socket_path" | |
echo "DOCKER_HOST=$docker_host" >> $GITHUB_ENV | |
echo ${DOCKER_HOST} | |
- name: Create a local image | |
run: | | |
docker pull nginx:1.21.6 | |
echo "hi" | |
echo ${DOCKER_HOST} | |
docker tag nginx:1.21.6 nginx:local | |
- name: Generate Trivy Report | |
uses: aquasecurity/[email protected] | |
with: | |
scan-type: "image" | |
format: "json" | |
output: "report.json" | |
ignore-unfixed: true | |
vuln-type: "os" | |
image-ref: "nginx:local" | |
docker-host: ${SOCKET} | |
- name: Run Copa action | |
id: copa | |
uses: project-copacetic/[email protected] | |
with: | |
image: "nginx:local" | |
image-report: report.json | |
patched-tag: "patched" | |
timeout: 5m | |
custom-socket: ${SOCKET} |