Skip to content

Commit

Permalink
Update GitHub workflows to use pinned commit hash versions (hashicorp…
Browse files Browse the repository at this point in the history
  • Loading branch information
arybolovlev authored Jan 27, 2023
1 parent c9182af commit 9f4f411
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 103 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/acceptance_tests_eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,13 @@ jobs:
acceptance_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: 'go.mod'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
with:
aws-region: ${{ github.event.inputs.region }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -56,7 +51,7 @@ jobs:
role-session-name: github-actions-tests-${{ github.run_number }}
role-duration-seconds: 14400
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: ${{ github.event.inputs.terraformVersion }}
- name: Provision EKS Cluster
Expand Down
59 changes: 22 additions & 37 deletions .github/workflows/acceptance_tests_gke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,18 @@ jobs:
env:
KUBECONFIG: ${{ github.workspace }}/kubernetes/test-infra/gke/kubeconfig
steps:
- uses: actions/checkout@v3
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: 'go.mod'
- name: Authenticate to Google Cloud
uses: "google-github-actions/auth@v0"
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
access_token_lifetime: "10800s"
- name: Install Terraform
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: ${{ github.event.inputs.terraformVersion }}
terraform_wrapper: false
Expand All @@ -75,7 +70,7 @@ jobs:
terraform init
terraform apply -auto-approve
- name: "Persist state"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: gke-cluster
retention-days: 1
Expand All @@ -89,24 +84,19 @@ jobs:
outputs:
test-case-matrix: ${{ steps.generate.outputs.test-case-matrix }}
steps:
- uses: actions/checkout@v3
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: 'go.mod'
- name: "Generate testcase matrix"
id: generate
run: |
make test-compile
./kubernetes.test -test.list '${{ github.event.inputs.runTests }}' | go run tools/batchacc.go -sort -depth 3 | tee groups.json
echo "::set-output name=test-case-matrix::$(cat groups.json)"
- name: "Persist test binary"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: test-binary
retention-days: 1
Expand All @@ -122,37 +112,32 @@ jobs:
matrix:
test-case: ${{ fromJson(needs.generate-case-matrix.outputs.test-case-matrix) }}
steps:
- uses: actions/checkout@v3
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: 'go.mod'
- name: Authenticate to Google Cloud
uses: "google-github-actions/auth@v0"
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
access_token_lifetime: "10800s"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v0"
uses: google-github-actions/setup-gcloud@v1
with:
install_components: "beta,gke-gcloud-auth-plugin"
- name: "Initialize gcloud SDK"
run: |
gcloud init
gcloud info
- name: "Fetch kubeconfig"
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: gke-cluster
path: |
${{ github.workspace }}/kubernetes/test-infra/gke
- name: "Fetch test binary"
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: test-binary
path: |
Expand All @@ -171,25 +156,25 @@ jobs:
needs: [prepare-gke-environment, acceptance-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: "Retrieve state"
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: gke-cluster
path: |
${{ github.workspace }}/kubernetes/test-infra/gke
- name: Authenticate to Google Cloud
uses: "google-github-actions/auth@v0"
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
access_token_lifetime: "10800s"
- name: Install Terraform
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: ${{ github.event.inputs.terraformVersion }}
terraform_wrapper: false
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v0"
uses: google-github-actions/setup-gcloud@v1
with:
install_components: "beta,gke-gcloud-auth-plugin"
- name: "Initialize gcloud SDK"
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/acceptance_tests_kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,17 @@ jobs:
acceptance_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: 'go.mod'
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: ${{ github.event.inputs.terraformVersion }}
- name: Setup kind
uses: engineerd/[email protected]
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0
with:
version: v${{ github.event.inputs.kindVersion }}
- name: Run Acceptance Test Suite
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/changelog-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # by default the checkout action doesn't checkout all branches
Expand All @@ -32,4 +32,4 @@ jobs:
exit 1
else
echo "Found .changelog entry in PR!"
fi
fi
15 changes: 5 additions & 10 deletions .github/workflows/check_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,19 @@ jobs:
KUBE_CONFIG_PATH: "~/.kube/config"
TERM: linux
steps:
- uses: hashicorp/setup-terraform@v1
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: ${{ matrix.terraform_version }}
- uses: actions/checkout@v2
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: 'go.mod'
- name: Go mod verify
run: go mod verify
- name: Go build
run: go build
- uses: engineerd/[email protected]
- uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0
with:
version: "v0.11.1"
- name: Check examples run
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@515828d97454b8354517688ddc5b48402b723750 # v2.1.38
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -49,7 +49,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@515828d97454b8354517688ddc5b48402b723750 # v2.1.38

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -63,4 +63,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@515828d97454b8354517688ddc5b48402b723750 # v2.1.38
2 changes: 1 addition & 1 deletion .github/workflows/issue-comment-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
issue_comment_triage:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-remove-labels@v1
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
with:
labels: |
stale
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/issue-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
issue_triage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: github/issue-labeler@v2.4
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: github/issue-labeler@6ca237433dbbb8e475241b7f38f4600d9e296c57 # v2.5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-issue-triage.yml
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/manifest_acc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@ jobs:
- 1.1.9
- 1.0.11
steps:
- uses: actions/checkout@v2
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
- uses: engineerd/[email protected]
go-version-file: 'go.mod'
- uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0
with:
version: v0.11.1
image: kindest/node:${{ matrix.kubernetes_version }}
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/manifest_unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read go-version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: 'go.mod'
- name: Go mod verify
run: go mod verify
- name: Run unit tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
- uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4 # v4.0.2
with:
configuration-path: .github/labeler-pull-request-triage.yml
repo-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
outputs:
version: ${{ steps.go-version.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- id: go-version
run: echo "::set-output name=version::$(cat ./.go-version)"
release-notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
- name: Generate Release Notes
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: release-notes
path: release-notes.txt
Expand Down
Loading

0 comments on commit 9f4f411

Please sign in to comment.