Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Golang
uses: actions/setup-go@v7
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7
with:
go-version-file: go.mod

Expand All @@ -43,10 +43,9 @@ jobs:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v7.0.1

uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@v0.36.0
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
continue-on-error: true
with:
scan-type: "fs"
Expand All @@ -57,7 +56,7 @@ jobs:
severity: "CRITICAL,HIGH,MEDIUM"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4.39.1
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: "trivy-results.sarif"

Expand All @@ -72,7 +71,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- id: govulncheck
uses: golang/govulncheck-action@v1
uses: golang/govulncheck-action@032d45514ae346b1db93c04b0c90b841c370344f # v1
with:
go-version-file: go.mod
go-package: ./...
Expand All @@ -86,7 +85,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Golang
uses: actions/setup-go@v7
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7
with:
go-version-file: go.mod

Expand All @@ -98,16 +97,12 @@ jobs:
run: make test

- name: check test coverage
uses: vladopajic/go-test-coverage@v2
uses: vladopajic/go-test-coverage@6890500b00a7e5862e54662c04ea9fa7c799ce1e # v2
with:
config: ./.testcoverage.yml

- name: Trigger Coverage update
uses: ./.github/workflows/coverage-badge.yaml
continue-on-error: true

- name: Generate code coverage artifacts
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: code-coverage
path: coverage.out
Expand All @@ -129,17 +124,16 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up QEMU
uses: docker/setup-qemu-action@v4

uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
with:
platforms: ${{ matrix.platform }}
driver: docker-container
use: true

- name: Build Images
uses: docker/build-push-action@v7
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
with:
context: .
platforms: ${{ matrix.platform }}
Expand All @@ -156,7 +150,7 @@ jobs:
type=provenance,mode=max

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@v0.36.0
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
input: ./.oci-image
format: "table"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/coverage-badge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
name: Update coverage badge
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.

- name: Setup go
uses: actions/setup-go@v7
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7
with:
go-version-file: 'go.mod'

Expand All @@ -29,12 +29,12 @@ jobs:
go tool cover -func=coverage.out -o=coverage.out

- name: Go Coverage Badge # Pass the `coverage.out` output to this action
uses: tj-actions/coverage-badge-go@v3
uses: tj-actions/coverage-badge-go@481919ec72da287775fef015fd9011dc75a5db05 # v3
with:
filename: coverage.out

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v20
uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20
id: verify-changed-files
with:
files: README.md
Expand All @@ -49,7 +49,7 @@ jobs:

- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
uses: ad-m/github-push-action@7fba72704ad2db819788db8f2d9e7d1dfbebe089 # master
with:
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}
branch: ${{ github.ref_name }}
4 changes: 4 additions & 0 deletions .github/workflows/dependabot-reviewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
# Actions and base-image bumps change what runs with repo secrets: a human reviews those.
if: steps.metadata.outputs.update-type != 'version-update:semver-major' && steps.metadata.outputs.package-ecosystem == 'go_modules'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
# Actions and base-image bumps change what runs with repo secrets: a human reviews those.
if: steps.metadata.outputs.update-type != 'version-update:semver-major' && steps.metadata.outputs.package-ecosystem == 'go_modules'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/helm-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v7.0.1
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check for values.yaml changes
uses: dorny/paths-filter@v4
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
id: filter
with:
filters: |
Expand All @@ -35,7 +32,7 @@ jobs:
- 'deploy/charts/version-checker/Chart.yaml'
- name: Install Helm Docs
if: steps.filter.outputs.values == 'true'
uses: envoy/install-helm-docs@v1.0.0
uses: envoy/install-helm-docs@05313083ef2cfaea27c4c3d7cb725242d22ea88b # v1.0.0
with:
version: 1.14.2
- name: Update Helm Docs
Expand All @@ -45,7 +42,7 @@ jobs:
cd deploy/charts/version-checker
helm-docs
- name: Check for README.md changes
uses: dorny/paths-filter@v4
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
id: filter-readme
with:
base: HEAD
Expand All @@ -62,8 +59,7 @@ jobs:
git commit -m "[HELM] Update helm docs"
- name: Push Changes
if: steps.filter-readme.outputs.readme == 'true'
uses: ad-m/github-push-action@v1.3.0
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
branch: ${{ github.ref_name }}
16 changes: 10 additions & 6 deletions .github/workflows/helm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Golang
uses: actions/setup-go@v7
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7
with:
go-version-file: go.mod

- uses: azure/setup-helm@v5
- uses: azure/setup-helm@2f5e7bc67f1f9972ab16657bb795f36d8f04de0e # v5
with:
version: v4.2.2

Expand All @@ -43,18 +43,19 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Golang
uses: actions/setup-go@v7
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7
with:
go-version-file: go.mod

- uses: azure/setup-helm@v5
- uses: azure/setup-helm@2f5e7bc67f1f9972ab16657bb795f36d8f04de0e # v5
with:
version: v4.2.2

- name: Install helm Plugins
run: |
if [ ! -e "${HELM_PLUGINS}/helm-unittest" ]; then
helm plugin install --verify=false https://github.com/helm-unittest/helm-unittest.git
# --verify=false: git installs carry no provenance, so pin a release tag instead.
helm plugin install --verify=false https://github.com/helm-unittest/helm-unittest.git --version v1.2.1
fi

- name: Run Tests
Expand All @@ -73,7 +74,10 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install Kyverno CLI
uses: kyverno/action-install-cli@v0.2.0
uses: kyverno/action-install-cli@fcee92fca5c883169ef9927acf543e0b5fc58289 # v0.2.0
with:
# The default (v1.10.3) cannot load policies.kyverno.io/v1 ValidatingPolicy.
release: v1.20.0

- run: |-
kyverno apply -p https://github.com/kyverno/policies/pod-security-vpol/restricted --git-branch main --resource <(helm template deploy/charts/version-checker/)
Loading