Skip to content

Commit

Permalink
fix: update deps, align ci pipelines (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis authored Sep 2, 2024
1 parent 475a017 commit 69d8c8e
Show file tree
Hide file tree
Showing 21 changed files with 628 additions and 838 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@ on:
branches:
- master

permissions: {}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
egress-policy: audit
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: 1.22.x
- name: Tests
run: make test
- name: Send go coverage report
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pr-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pr-actions

permissions: {}

on:
pull_request:
branches:
- 'master'

jobs:
ensure-sha-pinned:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@3c16e895bb662b4d7e284f032cbe8835a57773cc # v3.0.11
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
73 changes: 30 additions & 43 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- synchronize
- reopened

permissions: {}

jobs:
lint-chart:
runs-on: ubuntu-latest
Expand All @@ -16,7 +18,7 @@ jobs:
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

Expand All @@ -25,7 +27,7 @@ jobs:
with:
version: v3.4.0

- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.7

Expand All @@ -50,18 +52,11 @@ jobs:
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: 1.22.x
- name: fmt
run: make fmt
- name: vet
Expand All @@ -81,28 +76,21 @@ jobs:
strategy:
matrix:
kubernetes-version:
- "1.25"
- "1.26"
- "1.27"
- "1.28"
- "1.29"
- "1.30"
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: 1.22.x
- name: run test
run: make test ENVTEST_K8S_VERSION=${{ matrix.kubernetes-version }}

Expand All @@ -116,18 +104,11 @@ jobs:
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: 1.22.x
- name: build
run: make build
- name: Check if working tree is dirty
Expand All @@ -144,7 +125,7 @@ jobs:
run: |
docker save --output webhook-controller-container.tar webhook-controller:latest
- name: Upload image
uses: actions/upload-artifact@9ee08a3b00e91a926cc9547dc79589c20872452f # v3.2.0
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: webhook-controller-container
path: webhook-controller-container.tar
Expand All @@ -168,17 +149,17 @@ jobs:
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.20.x
go-version: 1.22.x
- name: Setup Kubernetes
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0
with:
version: v0.17.0
- name: Download webhook-controller container
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a #v3.0.2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: webhook-controller-container
path: /tmp
Expand All @@ -198,7 +179,7 @@ jobs:
kubectl -n webhook-system describe pods
kubectl -n webhook-system get all
kubectl -n webhook-system logs deploy/webhook-controller
kubectl -n webhook-system get requestclone -o yaml
kubectl -n webhook-system get webhookinstance -o yaml
test-chart:
runs-on: ubuntu-latest
Expand All @@ -211,14 +192,14 @@ jobs:
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5

- uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.7

Expand All @@ -229,7 +210,7 @@ jobs:
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0

- name: Download webhook-controller container
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: webhook-controller-container
path: /tmp
Expand All @@ -243,3 +224,9 @@ jobs:
- name: Run chart-testing (install)
run: ct install --target-branch=master --chart-dirs chart

test-success:
runs-on: ubuntu-latest
needs: [test, e2e-tests]
steps:
- run: echo "all tests succeeded"
27 changes: 27 additions & 0 deletions .github/workflows/pr-goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pr-gorelaser

permissions: {}

on:
pull_request:
branches:
- 'master'

jobs:
validate-config:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Validate .goreleaser.yaml
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: latest
args: check
env:
RUNNER_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.DOODLE_OSS_BOT}}
8 changes: 6 additions & 2 deletions .github/workflows/pr-label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ name: pr-label
on:
pull_request:

permissions: {}

jobs:
size-label:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
permissions:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
egress-policy: audit
- name: size-label
uses: "pascalgn/size-label-action@1619680c5ac1ef360b944bb56a57587ba4aa2af8"
uses: "pascalgn/size-label-action@49850f3557d4b77f0b2e759829defd77ccc07c54"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
18 changes: 18 additions & 0 deletions .github/workflows/pr-stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: pr-stale
on:
schedule:
- cron: '30 1 * * *'

permissions: {}

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
with:
days-before-close: '120'
stale-pr-label: stale
repo-token: ${{ github.token }}
28 changes: 28 additions & 0 deletions .github/workflows/pr-trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pr-trivy
on: pull_request

permissions: {}

jobs:
trivy:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

- name: Trivy fs scan
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # 0.24.0
with:
scan-type: 'fs'
ignore-unfixed: true
scanners: license,vuln,secret
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
with:
sarif_file: 'trivy-results.sarif'
13 changes: 9 additions & 4 deletions .github/workflows/rebase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ on:
issue_comment:
types: [created]

permissions: {}

jobs:
rebase:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
permissions:
contents: write # needed to force push
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
egress-policy: audit

- name: Checkout the latest code
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 #1.8
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
Loading

0 comments on commit 69d8c8e

Please sign in to comment.