Skip to content

Publish Kyverno Plugin #29

Publish Kyverno Plugin

Publish Kyverno Plugin #29

Workflow file for this run

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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # 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@5681af892cd0f4997658e2bacc62bd0a894cf564 # v0.27.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 }}