5
5
branches : [ main ]
6
6
pull_request :
7
7
8
+ permissions :
9
+ contents : read
10
+
8
11
jobs :
9
12
test :
13
+ permissions :
14
+ contents : read # for actions/checkout to fetch code
15
+ pull-requests : read # for SonarSource/sonarcloud-github-action to determine which PR to decorate
10
16
strategy :
11
17
# By default, GitHub will maximize the number of jobs run in parallel
12
18
# depending on the available runners on GitHub-hosted virtual machines.
@@ -18,16 +24,21 @@ jobs:
18
24
os : [ ubuntu-22.04, macos-latest, windows-latest ]
19
25
runs-on : ${{ matrix.os }}
20
26
steps :
21
- - uses : actions/checkout@v4
27
+ - name : Harden Runner
28
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
29
+ with :
30
+ egress-policy : audit
31
+
32
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22
33
with :
23
34
fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
24
35
- name : Set up Python ${{ matrix.python-version }}
25
- uses : actions/setup-python@v5
36
+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
26
37
with :
27
38
python-version : ${{ matrix.python-version }}
28
39
29
40
- name : Run image
30
- uses : abatilo/actions-poetry@v3
41
+ uses : abatilo/actions-poetry@fd0e6716a0de25ef6ade151b8b53190b0376acfd # v3
31
42
with :
32
43
poetry-version : ${{ matrix.poetry-version }}
33
44
47
58
48
59
- name : SonarCloud Scan
49
60
if : matrix.python-version == '3.10' && matrix.os == 'ubuntu-22.04' && matrix.poetry-version == '1.7.1'
50
- uses : SonarSource/sonarcloud-github-action@master
61
+ uses : SonarSource/sonarcloud-github-action@02ef91109b2d589e757aefcfb2854c2783fd7b19 # master
51
62
env :
52
63
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
53
64
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
0 commit comments