Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin all third-party GitHub actions to SHA version #379

Merged
merged 21 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1a79ef0
GHA: pin actions/cache
TylerHendrickson Sep 27, 2023
1b68211
GHA pin actions/checkout
TylerHendrickson Sep 27, 2023
72b5588
GHA pin actions/dependency-review-action
TylerHendrickson Sep 27, 2023
6778fec
GHA pin actions/download-artifact
TylerHendrickson Sep 27, 2023
7b747e6
GHA pin actions/upload-artifact
TylerHendrickson Sep 27, 2023
01e16db
GHA pin actions/setup-go
TylerHendrickson Sep 27, 2023
95acb94
GHA: pin arduino/setup-task
TylerHendrickson Sep 27, 2023
e1899d4
GHA: pin dependabot/fetch-metadata
TylerHendrickson Sep 27, 2023
4859dac
GHA: pin dominikh/staticcheck-action
TylerHendrickson Sep 27, 2023
460b62f
GHA: pin github/codeql-action
TylerHendrickson Sep 27, 2023
86f26f9
GHA: pin peter-evans/create-or-update-comment
TylerHendrickson Sep 27, 2023
7c572ec
GHA: pin peter-evans/find-comment
TylerHendrickson Sep 27, 2023
29cf919
GHA: pin release-drafter/release-drafter
TylerHendrickson Sep 27, 2023
d9e2697
GHA: pin terraform-linters/setup-tflint
TylerHendrickson Sep 27, 2023
2084c1e
Detect actions without pinned SHAs (test: should fail)
TylerHendrickson Sep 27, 2023
36c2272
Remove dry_run (test - should fail)
TylerHendrickson Sep 27, 2023
0607903
Pin action (done testing - should pass)
TylerHendrickson Sep 27, 2023
1a22782
Merge branch 'main' into 359/pin-gha-action-versions
TylerHendrickson Sep 27, 2023
77f3d80
Fix issue from merge conflict resolution
TylerHendrickson Sep 27, 2023
0513343
Merge branch 'main' into 359/pin-gha-action-versions
TylerHendrickson Sep 29, 2023
5b9106b
Merge branch 'main' into 359/pin-gha-action-versions
TylerHendrickson Sep 29, 2023
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
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ jobs:
proxy.golang.org:443
sum.golang.org:443
storage.googleapis.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
- uses: arduino/setup-task@v1
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1.0.3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Pre-build optimization
run: task prebuild-lambda
- name: Store build sources
id: store
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: ${{ env.SOURCES_KEY }}
path: ${{ env.SOURCES_PATH }}
Expand Down Expand Up @@ -115,15 +115,15 @@ jobs:
raw.githubusercontent.com:443
storage.googleapis.com:443
- name: Restore Go build sources
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ needs.prepare.outputs.sources-key }}
path: .
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
- uses: arduino/setup-task@v1
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1.0.3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
UPX_RESULT: ${{ steps.pack.outputs.result }}
- name: Store build artifacts
id: store
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: ${{ env.ARTIFACTS_KEY }}
path: ${{ env.ARTIFACTS_PATH }}
Expand Down Expand Up @@ -233,15 +233,15 @@ jobs:
raw.githubusercontent.com:443
storage.googleapis.com:443
- name: Restore Go build sources
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ needs.prepare.outputs.sources-key }}
path: .
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
- uses: arduino/setup-task@v1
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1.0.3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
UPX_RESULT: ${{ steps.pack.outputs.result }}
- name: Store build artifacts
id: store
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: ${{ env.ARTIFACTS_KEY }}
path: ${{ env.ARTIFACTS_PATH }}
Expand Down
33 changes: 27 additions & 6 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
allowed-endpoints: >
api.github.com:443
github.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/dependency-review-action@v3
- uses: actions/dependency-review-action@6c5ccdad469c9f8a2996bfecaec55a631a347034 # v3.1.0

codeql:
name: CodeQL
Expand All @@ -41,18 +41,39 @@ jobs:
with:
disable-sudo: true
egress-policy: audit
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: 'false'
persist-credentials: 'false'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@8e0b1c74b1d5a0077b04d064c76ee714d3da7637 # v2.14.6
with:
languages: go
queries: security-extended,security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@8e0b1c74b1d5a0077b04d064c76ee714d3da7637 # v2.14.6
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@8e0b1c74b1d5a0077b04d064c76ee714d3da7637 # v2.14.6
with:
category: "/language:go"

gha-workflow-security:
name: GHA Workflow Security
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
contents: read
steps:
- uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: 'false'
persist-credentials: 'false'
- name: Ensure GitHub action versions are pinned to SHAs
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@f32435541e24cd6a4700a7f52bb2ec59e80603b1 # v2.1.4
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0
- name: Approve a PR if dependency semver changes are minor or patch
if: ${{contains(fromJson('["version-update:semver-patch", "version-update:semver-minor"]'), steps.dependabot-metadata.outputs.update-type)}}
run: gh pr review --approve "$PR_URL"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Get release notes
id: get
continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ jobs:
- name: Find previous report comment
id: find-comment
if: inputs.write-comment && inputs.pr-number != ''
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2.4.0
with:
issue-number: ${{ inputs.pr-number }}
comment-author: 'github-actions[bot]'
body-includes: Terraform Summary
- name: Create or update comment
if: inputs.write-comment && inputs.pr-number != ''
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
Expand Down
41 changes: 20 additions & 21 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ jobs:
proxy.golang.org:443
sum.golang.org:443
storage.googleapis.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- name: Restore/save Taskfile cache
uses: actions/cache@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
key: ${{ runner.os }}-qa-taskfile
path: |
./.task
./bin
./cover.out
./cover.html
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
- uses: arduino/setup-task@v1
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1.0.3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
Expand All @@ -70,25 +70,25 @@ jobs:
proxy.golang.org:443
sum.golang.org:443
storage.googleapis.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- name: Restore Taskfile cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
key: ${{ runner.os }}-qa-taskfile
path: |
./.task
./bin
./cover.out
./cover.html
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
- uses: arduino/setup-task@v1
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1.0.3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
Expand All @@ -109,13 +109,12 @@ jobs:
github.com:443
proxy.golang.org:443
sum.golang.org:443
storage.googleapis.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
Expand All @@ -137,17 +136,17 @@ jobs:
proxy.golang.org:443
sum.golang.org:443
storage.googleapis.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
- name: Lint with Staticcheck
uses: dominikh/[email protected]
uses: dominikh/staticcheck-action@ba605356b4b29a60e87ab9404b712f3461e566dc # v1.3.0
with:
install-go: false

Expand All @@ -168,25 +167,25 @@ jobs:
proxy.golang.org:443
sum.golang.org:443
storage.googleapis.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- name: Restore Taskfile cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
key: ${{ runner.os }}-qa-taskfile
path: |
./.task
./bin
./cover.out
./cover.html
- uses: actions/setup-go@v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod
- uses: arduino/setup-task@v1
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1.0.3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
Expand All @@ -206,17 +205,17 @@ jobs:
api.github.com:443
github.com:443
objects.githubusercontent.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/cache@v3
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
name: Cache plugin dir
with:
path: .tflint.d/plugins
key: ${{ runner.os }}-tflint-${{ hashFiles('terraform/.tflint.hcl') }}
- uses: terraform-linters/setup-tflint@v4
- uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4.0.0
name: Setup TFLint
with:
tflint_version: latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: "Determine next version"
id: next_version
run: |
chmod +x .github/next_release_version.bash
echo "result=$(bash .github/next_release_version.bash)" >> $GITHUB_OUTPUT
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@65c5fb495d1e69aa8c08a3317bc44ff8aabe9772 # v5.24.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/terraform-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
registry.terraform.io:443
releases.hashicorp.com:443
- name: Download Terraform artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ inputs.tf-plan-artifacts-key }}
path: ${{ github.workspace }}/terraform
Expand All @@ -90,7 +90,7 @@ jobs:
with:
terraform_version: ${{ steps.get_tf_version.outputs.TF_VERSION }}
- name: Download Lambda handler artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ inputs.bin-artifacts-key }}
path: ${{ inputs.bin-artifacts-path }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
objects.githubusercontent.com:443
registry.terraform.io:443
releases.hashicorp.com:443
- uses: actions/checkout@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: ${{ inputs.ref }}
show-progress: 'false'
Expand All @@ -124,7 +124,7 @@ jobs:
env:
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
- name: Download Lambda handler artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ inputs.bin-artifacts-key }}
path: ${{ inputs.bin-artifacts-path }}
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
rm tfplan
- name: Store terraform artifacts
if: success() && inputs.upload-artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: ${{ env.ARTIFACTS_KEY }}
path: |
Expand Down
Loading