-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Frank Jogeleit <[email protected]>
- Loading branch information
Showing
6 changed files
with
91 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,26 +20,56 @@ jobs: | |
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.2.0 | ||
with: | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Get dependencies | ||
run: go get -v -t -d ./... | ||
- name: Check go.mod | ||
run: | | ||
set -e | ||
go mod tidy && git diff --exit-code | ||
- name: Check code format | ||
run: | | ||
set -e | ||
make fmt | ||
git diff --exit-code | ||
- name: Run Trivy vulnerability scanner in repo mode | ||
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # v0.24.0 | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH' | ||
|
||
- name: Calc coverage | ||
run: make coverage | ||
|
||
- name: Convert coverage to lcov | ||
uses: jandelgado/[email protected] | ||
uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5 #v1.0.9 | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@v2.0.0 | ||
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
file: coverage.lcov | ||
file: coverage.lcov | ||
|
||
check-actions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
- name: Ensure SHA pinned actions | ||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@b8f9a25a51fe633d9215ac7734854dc11cd299cb # v3.0.13 | ||
with: | ||
# slsa-github-generator requires using a semver tag for reusable workflows. | ||
# See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators | ||
allowlist: | | ||
slsa-framework/slsa-github-generator |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: release-chart | |
on: | ||
push: | ||
tags: | ||
- 'policy-reporter-preview-chart-v*' | ||
- 'policy-reporter-chart-v*' | ||
|
||
jobs: | ||
helm-chart: | ||
|
@@ -13,7 +13,7 @@ jobs: | |
pages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -28,11 +28,38 @@ jobs: | |
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | ||
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | ||
with: | ||
version: v3.10.3 | ||
version: v3.16.1 | ||
|
||
- name: Prepare GPG key | ||
run: | | ||
gpg_dir=.cr-gpg | ||
mkdir "$gpg_dir" | ||
keyring="$gpg_dir/secring.gpg" | ||
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" | ||
passphrase_file="$gpg_dir/passphrase" | ||
echo "$GPG_PASSPHRASE" > "$passphrase_file" | ||
echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" | ||
echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV" | ||
env: | ||
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" #Referring secrets of github above | ||
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" | ||
|
||
- name: Run chart-releaser | ||
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0 | ||
id: cr | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_KEY: "${{ secrets.CR_KEY }}" | ||
CR_SIGN: true | ||
|
||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0 | ||
|
||
- name: Push to OCI | ||
run: | | ||
set -e | ||
output=$(helm push .cr-release-packages/policy-reporter-{{ steps.cr.outputs.chart_version }}.tgz oci://ghcr.io/kyverno/charts 2>&1) | ||
digest=$( echo "$output" | grep Digest | cut -c9-) | ||
cosign sign --yes ghcr.io/kyverno/charts/policy-reporter@$digest |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Pushed: ghcr.io/fjogeleit/charts/policy-reporter-preview:3.0.0-beta.18 | ||
Digest: sha256:ebc720b178dbbdc5def056e0d8c57a9475180d087c68c7afdf64ea5bbaff6eab |