-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.46 KB
/
kyverno-plugin.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Publish Kyverno Plugin
on:
push:
tags:
- 'kyverno-plugin-v*'
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish-images:
runs-on: ubuntu-latest
permissions:
packages: write
id-token: write
outputs:
digest: ${{ steps.publish.outputs.digest }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: plugins/trivy/go.mod
cache-dependency-path: plugins/trivy/go.sum
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Install Cosign
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
- name: Set version
run: |
set -e
TAG=${{ github.ref_name }}
echo "VERSION=${TAG#kyverno-plugin-v}" >> $GITHUB_ENV
- name: Publish Kyverno Plugin
id: publish
uses: ./.github/actions/publish
with:
plugin: kyverno
name: policy-reporter/kyverno-plugin
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.VERSION }}
sbom-name: kyverno-plugin
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom/policy-reporter
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures/policy-reporter
generate-provenance:
needs: publish-images
permissions:
id-token: write # To sign the provenance.
packages: write # To upload assets to release.
actions: read # To read the workflow path.
# NOTE: The container generator workflow is not officially released as GA.
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
image: ghcr.io/${{ github.repository_owner }}/policy-reporter/kyverno-plugin
digest: "${{ needs.publish-images.outputs.digest }}"
registry-username: ${{ github.actor }}
secrets:
registry-password: ${{ secrets.GITHUB_TOKEN }}