-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pinned GitHub workflows by SHA (#8334)
- Pinned actions by SHA https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies - Included permissions for some of the actions. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions Dependabot can upgrade pinned version of actions.
- Loading branch information
1 parent
e1eff78
commit 974d038
Showing
3 changed files
with
50 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 |
---|---|---|
|
@@ -9,9 +9,15 @@ on: | |
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
changes: | ||
permissions: | ||
contents: read # for dorny/paths-filter to fetch a list of changed files | ||
pull-requests: read # for dorny/paths-filter to read pull requests | ||
runs-on: ubuntu-latest | ||
outputs: | ||
go: ${{ steps.filter.outputs.go }} | ||
|
@@ -20,9 +26,9 @@ jobs: | |
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721 # v2 | ||
id: filter | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -43,10 +49,10 @@ jobs: | |
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
uses: securego/gosec@b99b5f7838e43a4104354ad92a6a1774302ee1f9 # master | ||
with: | ||
# G601 for zz_generated.deepcopy.go | ||
# G306 TODO: Expect WriteFile permissions to be 0600 or less | ||
|
@@ -61,17 +67,17 @@ jobs: | |
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- name: Set up Go 1.17 | ||
id: go | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2 | ||
with: | ||
go-version: '1.17.6' | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: crazy-max/ghaction-docker-buildx@v1 | ||
uses: crazy-max/ghaction-docker-buildx@e01797ad2ea9a981005ad58c99afa8d842e3d3eb # v1 | ||
with: | ||
buildx-version: latest | ||
qemu-version: latest | ||
|
@@ -104,7 +110,7 @@ jobs: | |
| pigz > docker.tar.gz | ||
- name: cache | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2 | ||
with: | ||
name: docker.tar.gz | ||
path: docker.tar.gz | ||
|
@@ -121,15 +127,15 @@ jobs: | |
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2 | ||
with: | ||
go-version: '1.17.6' | ||
|
||
- name: cache | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869 # v2 | ||
with: | ||
name: docker.tar.gz | ||
|
||
|
@@ -162,12 +168,12 @@ jobs: | |
- name: Create Kubernetes cluster | ||
id: kind | ||
uses: engineerd/[email protected] | ||
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0 | ||
with: | ||
version: v0.11.1 | ||
image: kindest/node:v1.21.1 | ||
|
||
- uses: geekyeggo/delete-artifact@v1 | ||
- uses: geekyeggo/delete-artifact@a6ab43859c960a8b74cbc6291f362c7fb51829ba # v1 | ||
with: | ||
name: docker.tar.gz | ||
failOnError: false | ||
|
@@ -202,22 +208,22 @@ jobs: | |
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- name: cache | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869 # v2 | ||
with: | ||
name: docker.tar.gz | ||
|
||
- name: Create Kubernetes ${{ matrix.k8s }} cluster | ||
id: kind | ||
uses: engineerd/[email protected] | ||
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0 | ||
with: | ||
version: v0.11.1 | ||
config: test/e2e/kind.yaml | ||
image: kindest/node:${{ matrix.k8s }} | ||
|
||
- uses: geekyeggo/delete-artifact@v1 | ||
- uses: geekyeggo/delete-artifact@a6ab43859c960a8b74cbc6291f362c7fb51829ba # v1 | ||
with: | ||
name: docker.tar.gz | ||
failOnError: false | ||
|
@@ -245,14 +251,17 @@ jobs: | |
make kind-e2e-test | ||
test-image-build: | ||
permissions: | ||
contents: read # for dorny/paths-filter to fetch a list of changed files | ||
pull-requests: read # for dorny/paths-filter to read pull requests | ||
runs-on: ubuntu-latest | ||
env: | ||
PLATFORMS: linux/amd64 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721 # v2 | ||
id: filter-images | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -302,14 +311,17 @@ jobs: | |
cd images/kube-webhook-certgen && make build | ||
test-image: | ||
permissions: | ||
contents: read # for dorny/paths-filter to fetch a list of changed files | ||
pull-requests: read # for dorny/paths-filter to read pull requests | ||
runs-on: ubuntu-latest | ||
env: | ||
PLATFORMS: linux/amd64 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721 # v2 | ||
id: filter-images | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -320,15 +332,15 @@ jobs: | |
- name: Create Kubernetes cluster | ||
id: kind | ||
if: ${{ steps.filter-images.outputs.kube-webhook-certgen == 'true' }} | ||
uses: engineerd/[email protected] | ||
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0 | ||
with: | ||
version: v0.11.1 | ||
image: kindest/node:v1.21.1 | ||
|
||
- name: Set up Go 1.17 | ||
id: go | ||
if: ${{ steps.filter-images.outputs.kube-webhook-certgen == 'true' }} | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2 | ||
with: | ||
go-version: '1.17.6' | ||
|
||
|
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 |
---|---|---|
|
@@ -9,6 +9,9 @@ on: | |
jobs: | ||
|
||
changes: | ||
permissions: | ||
contents: read # for dorny/paths-filter to fetch a list of changed files | ||
pull-requests: read # for dorny/paths-filter to read pull requests | ||
runs-on: ubuntu-latest | ||
if: | | ||
(github.repository == 'kubernetes/ingress-nginx') | ||
|
@@ -19,9 +22,9 @@ jobs: | |
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721 # v2 | ||
id: filter | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -46,7 +49,7 @@ jobs: | |
steps: | ||
|
||
- name: Checkout master | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 | ||
with: | ||
# Fetch entire history. Required for chart-releaser; see https://github.com/helm/chart-releaser-action/issues/13#issuecomment-602063896 | ||
fetch-depth: 0 | ||
|
@@ -58,7 +61,7 @@ jobs: | |
git config --global user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
uses: helm/chart-releaser-action@c25b74a986eb925b398320414b576227f375f946 # v1.2.1 | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}" | ||
|