Skip to content

Commit 53c9ee0

Browse files
authored
pin GitHub Actions by SHA (#411)
Also add scorecard workflow to help identify security issues
1 parent 7382607 commit 53c9ee0

File tree

5 files changed

+54
-54
lines changed

5 files changed

+54
-54
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1414

1515
- name: Set up Go
16-
uses: actions/setup-go@v5
16+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
1717
with:
1818
go-version-file: go.mod
1919

@@ -28,10 +28,10 @@ jobs:
2828
lint:
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3232

3333
- name: Set up Go
34-
uses: actions/setup-go@v5
34+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
3535
with:
3636
go-version-file: go.mod
3737

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL"
132

143
on:
154
schedule:
16-
- cron: '22 17 * * 1'
5+
- cron: '22 17 * * 1' # https://crontab.guru/#22_17_*_*_1
176

187
jobs:
198
analyze:
@@ -24,49 +13,21 @@ jobs:
2413
contents: read
2514
security-events: write
2615

27-
strategy:
28-
fail-fast: false
29-
matrix:
30-
language: [ 'go' ]
31-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
32-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
33-
3416
steps:
3517
- name: Checkout repository
36-
uses: actions/checkout@v4
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3719

38-
# The runner ships with v1.20.14
39-
- uses: actions/setup-go@v5
20+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
4021
with:
4122
go-version-file: go.mod
4223

43-
# Initializes the CodeQL tools for scanning.
4424
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
25+
uses: github/codeql-action/init@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
4626
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
52-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53-
# queries: security-extended,security-and-quality
54-
27+
languages: 'go'
5528

56-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57-
# If this step fails, then you should remove it and run the build manually (see below)
5829
- name: Autobuild
59-
uses: github/codeql-action/autobuild@v3
60-
61-
# ℹ️ Command-line programs to run using the OS shell.
62-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63-
64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
65-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66-
67-
# - run: |
68-
# echo "Run, Build Application using script"
69-
# ./location_of_script_within_repo/buildscript.sh
30+
uses: github/codeql-action/autobuild@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
7031

7132
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v3
33+
uses: github/codeql-action/analyze@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
- goarch: arm64
2222
goos: windows
2323
steps:
24-
- uses: actions/checkout@v4
25-
- uses: wangyoucao577/go-release-action@v1.52
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
26+
- uses: wangyoucao577/go-release-action@481a2c1a0f1be199722e3e9b74d7199acafc30a8 # v1.53
2627
with:
2728
goversion: go.mod
2829
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/scorecard.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Scorecard analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: '22 17 * * 1' # https://crontab.guru/#22_17_*_*_1
9+
workflow_dispatch:
10+
11+
permissions:
12+
actions: read
13+
checks: read
14+
contents: read
15+
issues: read
16+
pull-requests: read
17+
statuses: read
18+
# Needed for SARIF upload
19+
security-events: write
20+
21+
jobs:
22+
analysis:
23+
name: Scorecard analysis
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
30+
31+
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
32+
with:
33+
results_file: results.sarif
34+
results_format: sarif
35+
36+
- uses: github/codeql-action/upload-sarif@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
37+
with:
38+
sarif_file: results.sarif

.github/workflows/smoke.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
matrix:
2828
suite: ${{ fromJSON(needs.suites.outputs.suites) }}
2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3131

3232
- name: Set up Go
33-
uses: actions/setup-go@v5
33+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
3434
with:
3535
go-version-file: go.mod
3636

0 commit comments

Comments
 (0)