Skip to content

Commit 5482882

Browse files
committed
.github/workflows: update codeql job
1 parent c3b5d5c commit 5482882

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,23 @@
1111
#
1212
name: "CodeQL"
1313

14+
permissions:
15+
contents: read
16+
1417
on:
1518
push:
16-
branches: [main]
19+
branches: [ main ]
20+
paths-ignore:
21+
- '**/*.md'
22+
- '**/*.txt'
23+
- '**/*.yaml'
1724
pull_request:
1825
# The branches below must be a subset of the branches above
19-
branches: [main]
26+
branches: [ main ]
27+
paths-ignore:
28+
- '**/*.md'
29+
- '**/*.txt'
30+
- '**/*.yaml'
2031
schedule:
2132
- cron: '30 20 * * 2'
2233

@@ -32,39 +43,37 @@ jobs:
3243
strategy:
3344
fail-fast: false
3445
matrix:
35-
language: ['go']
46+
language: [ 'go' ]
3647
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3748
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3849

3950
steps:
51+
- name: Harden Runner
52+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
53+
with:
54+
egress-policy: audit
55+
4056
- name: Checkout repository
41-
uses: actions/checkout@v4
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
- name: Setup go
59+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
60+
with:
61+
go-version-file: "go.mod"
4262

4363
# Initializes the CodeQL tools for scanning.
4464
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
65+
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
4666
with:
4767
languages: ${{ matrix.language }}
4868
# If you wish to specify custom queries, you can do so here or in a config file.
4969
# By default, queries listed here will override any specified in a config file.
5070
# Prefix the list here with "+" to use these queries and those in the config file.
5171
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5272

53-
# setup cache to speed up the action
54-
- uses: actions/cache@v4
55-
with:
56-
path: |
57-
~/.cache/go-build
58-
~/.cache/pip
59-
~/go/pkg/mod
60-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
61-
restore-keys: |
62-
${{ runner.os }}-go-
63-
6473
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6574
# If this step fails, then you should remove it and run the build manually (see below)
6675
# - name: Autobuild
67-
# uses: github/codeql-action/autobuild@v3
76+
# uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
6877

6978
# ℹ️ Command-line programs to run using the OS shell.
7079
# 📚 https://git.io/JvXDl
@@ -81,4 +90,4 @@ jobs:
8190
make bin/tkn
8291
8392
- name: Perform CodeQL Analysis
84-
uses: github/codeql-action/analyze@v3
93+
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11

0 commit comments

Comments
 (0)