8
8
branches :
9
9
- main
10
10
11
+ permissions :
12
+ contents : read
13
+ issues : write
14
+
11
15
jobs :
12
16
sanity :
13
17
name : Sanity
14
18
runs-on : ubuntu-20.04
15
19
16
20
steps :
21
+ - name : Harden Runner
22
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
23
+ with :
24
+ egress-policy : audit
25
+
17
26
- name : Checkout
18
-
27
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
19
28
20
29
- name : Install Python
21
-
30
+ uses : actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
22
31
with :
23
32
python-version : ' 3.11'
24
33
25
34
- name : Run pre-commit checks
26
- uses :
pre-commit/[email protected]
35
+ uses : pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
27
36
env :
28
37
SETUPTOOLS_USE_DISTUTILS : stdlib
29
38
35
44
runs-on : ubuntu-20.04
36
45
37
46
steps :
47
+ - name : Harden Runner
48
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
49
+ with :
50
+ egress-policy : audit
51
+
38
52
- name : Checkout
39
-
53
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
40
54
with :
41
55
fetch-depth : 0
42
56
57
71
58
72
- name : Get changed files
59
73
id : changed-files
60
- uses :
tj-actions/[email protected]
74
+ uses : tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44.5.2
61
75
with :
62
76
files_from_source_file : docker-files.txt
63
77
70
84
71
85
- name : Setting smokes-required label
72
86
if : env.RUN_TESTS == 'true'
73
-
87
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
74
88
continue-on-error : true
75
89
with :
76
90
script : |
89
103
90
104
- name : Remove smokes-required label
91
105
if : env.RUN_TESTS != 'true'
92
-
106
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
93
107
continue-on-error : true
94
108
with :
95
109
script : |
@@ -113,14 +127,19 @@ jobs:
113
127
run_tests : ${{ steps.check-files-or-fork.outputs.run_tests }}
114
128
115
129
steps :
130
+ - name : Harden Runner
131
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
132
+ with :
133
+ egress-policy : audit
134
+
116
135
- name : Checkout
117
-
136
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
118
137
with :
119
138
fetch-depth : 0
120
139
121
140
- name : Get changed files
122
141
id : changed-files
123
- uses :
tj-actions/[email protected]
142
+ uses : tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44.5.2
124
143
with :
125
144
files : |
126
145
db_functions/**
@@ -158,9 +177,14 @@ jobs:
158
177
COMPOSE_FILE : .github/postgres/docker-compose.yaml
159
178
160
179
steps :
180
+ - name : Harden Runner
181
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
182
+ with :
183
+ egress-policy : audit
184
+
161
185
- name : Checkout
162
186
if : needs.changed-files.outputs.run_tests == 'true'
163
-
187
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
164
188
with :
165
189
fetch-depth : 0
166
190
@@ -174,7 +198,7 @@ jobs:
174
198
175
199
- name : Set up Python ${{ matrix.python-version }}
176
200
if : needs.changed-files.outputs.run_tests == 'true'
177
-
201
+ uses : actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
178
202
with :
179
203
python-version : ${{ matrix.python-version }}
180
204
@@ -185,7 +209,7 @@ jobs:
185
209
- name : Cache dependencies
186
210
if : needs.changed-files.outputs.run_tests == 'true'
187
211
id : cache-dependencies
188
-
212
+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
189
213
with :
190
214
path : |
191
215
~/.cache/pipenv
@@ -243,35 +267,44 @@ jobs:
243
267
244
268
- name : Upload test coverage file
245
269
if : steps.unit_tests_run.outcome == 'success'
246
-
270
+ uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
247
271
with :
248
272
name : coverage
249
273
path : coverage.xml
250
274
overwrite : true
251
275
252
276
coverage :
253
277
name : Coverage
254
- needs : [changed-files,units]
278
+ needs : [ changed-files,units ]
255
279
runs-on : ubuntu-20.04
280
+ permissions :
281
+ contents : write
282
+ statuses : write
283
+
256
284
steps :
257
285
286
+ - name : Harden Runner
287
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
288
+ with :
289
+ egress-policy : audit
290
+
258
291
- name : Checkout
259
292
# this checkout is required for the coverage report. If we don't do this, then
260
293
# the uploaded report is invalid and codecov doesn't know how to process it.
261
294
if : needs.changed-files.outputs.run_tests == 'true'
262
-
295
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
263
296
with :
264
297
fetch-depth : 0
265
298
266
299
- name : Download coverage result from units
267
300
if : needs.changed-files.outputs.run_tests == 'true'
268
-
301
+ uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
269
302
with :
270
303
name : coverage
271
304
272
305
- name : Upload coverage to Codecov
273
306
if : needs.changed-files.outputs.run_tests == 'true'
274
-
307
+ uses : codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1
275
308
env :
276
309
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
277
310
with :
0 commit comments