Merge pull request #18918 from etcd-io/dependabot/docker/distroless/s… #13211
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: Release | |
on: [push, pull_request] | |
permissions: read-all | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- id: goversion | |
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version: ${{ steps.goversion.outputs.goversion }} | |
- name: release | |
run: | | |
set -euo pipefail | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Action" | |
gpg --batch --gen-key <<EOF | |
%no-protection | |
Key-Type: 1 | |
Key-Length: 2048 | |
Subkey-Type: 1 | |
Subkey-Length: 2048 | |
Name-Real: Github Action | |
Name-Email: [email protected] | |
Expire-Date: 0 | |
EOF | |
DRY_RUN=true ./scripts/release.sh --no-upload --no-docker-push --no-gh-release --in-place 3.6.99 | |
- name: test-image | |
run: | | |
VERSION=3.6.99 ./scripts/test_images.sh | |
- name: save-image | |
run: | | |
docker image save -o /tmp/etcd-img.tar gcr.io/etcd-development/etcd | |
- name: upload-image | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: etcd-img | |
path: /tmp/etcd-img.tar | |
retention-days: 1 | |
trivy-scan: | |
needs: main | |
strategy: | |
fail-fast: false | |
matrix: | |
platforms: [amd64, arm64, ppc64le, s390x] | |
permissions: | |
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
runs-on: ubuntu-latest | |
steps: | |
- name: get-image | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: etcd-img | |
path: /tmp | |
- name: load-image | |
run: | | |
docker load < /tmp/etcd-img.tar | |
- name: trivy-scan | |
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0 | |
with: | |
image-ref: 'gcr.io/etcd-development/etcd:v3.6.99-${{ matrix.platforms }}' | |
severity: 'CRITICAL,HIGH' | |
format: 'sarif' | |
output: 'trivy-results-${{ matrix.platforms }}.sarif' | |
env: | |
# Use AWS' ECR mirror for the trivy-db image, as GitHub's Container | |
# Registry is returning a TOOMANYREQUESTS error. | |
# Ref: https://github.com/aquasecurity/trivy-action/issues/389 | |
TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db:2' | |
- name: upload scan results | |
uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 | |
with: | |
sarif_file: 'trivy-results-${{ matrix.platforms }}.sarif' |