Skip to content

Commit 193218c

Browse files
author
Joonas Hiltunen
committed
Add permissions to workflows
1 parent 3db2a3c commit 193218c

8 files changed

Lines changed: 79 additions & 59 deletions

.github/workflows/check-renovatebot-config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
validate:
11-
uses: HSLdevcom/jore4-tools/.github/workflows/shared-check-renovatebot-config.yml@shared-check-renovatebot-config-v1
14+
uses: HSLdevcom/jore4-tools/.github/workflows/shared-check-renovatebot-config.yml@shared-check-renovatebot-config-v2
1215
with:
1316
config_file_path: renovatebot/jore4-default-preset.json5

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ name: CI
33
on:
44
pull_request:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
run_e2e_tests_workflow:
811
name: Test run E2E tests workflow
912
uses: ./.github/workflows/shared-run-e2e.yml
1013
with:
11-
test-tags: ''
14+
test-tags: ""

.github/workflows/doctoc.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
verify-doctoc:
1114
name: Verifies whether table of contents has been updated
1215
runs-on: ubuntu-24.04
1316

1417
steps:
1518
- name: Checkout code
16-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
1720

1821
- name: Run doctoc on README
1922
run: npx doctoc README.md

.github/workflows/shared-build-and-publish-docker-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ on:
2424
description: Docker build context. This needs to be Git repository context; see https://docs.docker.com/build/concepts/context/#url-fragments
2525
type: string
2626
required: false
27-
default: null
27+
default: ""
2828
build_args:
2929
description: Docker build time arguments
3030
type: string
3131
required: false
32-
default: null
32+
default: ""
3333
target:
3434
description: Sets the target stage to build
3535
type: string
3636
required: false
37-
default: null
37+
default: ""
3838
artifact-id:
3939
description: Artifact ID needed to download for the build.
4040
type: string
4141
required: false
42-
default: null
42+
default: ""
4343
artifact-path:
4444
description: Target where to download the artifact.
4545
type: string
@@ -110,7 +110,7 @@ jobs:
110110
# Checkout is needed when context is local "."
111111
# Otherwise the repository code will not be fetched for the build
112112
if: ${{ inputs.context == '.' }}
113-
uses: actions/checkout@v5
113+
uses: actions/checkout@v6
114114

115115
- name: Download artifacts
116116
if: ${{ inputs.artifact-id }}

.github/workflows/shared-check-renovatebot-config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
required: false
1414
default: "false"
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
validate:
1821
name: Validate renovatebot config

.github/workflows/shared-run-e2e.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
Git repository's main branch.
1212
type: string
1313
required: false
14-
default: null
14+
default: ""
1515
ui_version:
1616
description:
1717
Version of ui to use (docker image tag). Set to "" if using the default
@@ -97,7 +97,8 @@ on:
9797
required: false
9898
default: ""
9999
tiamat_version:
100-
description: Version of tiamat to use (docker image tag). Set to "" if using
100+
description:
101+
Version of tiamat to use (docker image tag). Set to "" if using
101102
the default version.
102103
type: string
103104
required: false
@@ -124,11 +125,10 @@ on:
124125
required: false
125126
default: "@smoke"
126127
video:
127-
description:
128-
Turn video on or off. Supported values are 'true' and 'false'.
128+
description: Turn video on or off. Supported values are 'true' and 'false'.
129129
type: string
130130
required: false
131-
default: 'false'
131+
default: "false"
132132
update_e2e_test_durations:
133133
description: |
134134
Should the E2E test durations be updated to jore4-ci-data repository's e2e-test-durations branch
@@ -140,10 +140,12 @@ on:
140140
default: false
141141
secrets:
142142
jore4_ci_data_repo_ssh_key:
143-
description:
144-
SSH key that can be used to write to HSLdevcom/jore4-ci-data repository.
143+
description: SSH key that can be used to write to HSLdevcom/jore4-ci-data repository.
145144
required: false
146145

146+
permissions:
147+
contents: read
148+
147149
jobs:
148150
run_e2e_tests:
149151
name: Run e2e tests
@@ -231,7 +233,7 @@ jobs:
231233
cat ${{ github.workspace }}/durations.out.json
232234
233235
- name: Upload test durations
234-
uses: actions/upload-artifact@v4
236+
uses: actions/upload-artifact@v5
235237
with:
236238
name: "e2e-test-durations-${{ strategy.job-index }}"
237239
path: ${{ github.workspace }}/durations.out.json
@@ -247,7 +249,7 @@ jobs:
247249
- name: Upload test reports as an artifact
248250
# Should be run especially when tests fail
249251
if: always()
250-
uses: actions/upload-artifact@v4
252+
uses: actions/upload-artifact@v5
251253
with:
252254
name: cypress-test-results-${{ strategy.job-index }}
253255
path: ${{ github.workspace }}/ctrf-report.json
@@ -273,7 +275,7 @@ jobs:
273275
274276
- name: Upload test reports as an artifact
275277
if: always() && steps.copy_test_reports.outputs.test_reports_exist == 'true'
276-
uses: actions/upload-artifact@v4
278+
uses: actions/upload-artifact@v5
277279
with:
278280
name: cypress-docker-reports-${{ strategy.job-index }}
279281
path: ${{ github.workspace }}/test-reports
@@ -285,7 +287,7 @@ jobs:
285287
- run_e2e_tests
286288
steps:
287289
- name: Download E2E Test Results
288-
uses: actions/download-artifact@v4
290+
uses: actions/download-artifact@v5
289291
continue-on-error: true
290292
with:
291293
pattern: cypress-test-results-*
@@ -294,7 +296,7 @@ jobs:
294296
- name: Publish Test Report
295297
uses: ctrf-io/github-test-reporter@27b97adba93f02142c573c8a710045cac0d874ae # v1.0.14
296298
with:
297-
report-path: 'ctrf/*/*.json'
299+
report-path: "ctrf/*/*.json"
298300
summary-report: true
299301
failed-report: true
300302
flaky-report: true
@@ -309,15 +311,15 @@ jobs:
309311
- run_e2e_tests
310312
steps:
311313
- name: Checkout
312-
uses: actions/checkout@v4
314+
uses: actions/checkout@v6
313315
with:
314316
fetch-depth: 0
315-
repository: 'HSLdevcom/jore4-ci-data'
317+
repository: "HSLdevcom/jore4-ci-data"
316318
ref: e2e-test-durations
317319
ssh-key: ${{ secrets.jore4_ci_data_repo_ssh_key }}
318320

319321
- name: Download E2E Test Durations
320-
uses: actions/download-artifact@v4
322+
uses: actions/download-artifact@v6
321323
with:
322324
pattern: e2e-test-durations-*
323325
path: ${{ github.workspace }}/split-durations

.github/workflows/test-healthcheck-action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test-healthcheck-success:
1114
name: Verifies whether healthcheck action succeeds when it should
1215
runs-on: ubuntu-24.04
1316

1417
steps:
1518
- name: Checkout code
16-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
1720

1821
- name: Startup sample HTTP server
1922
run: docker run -d -p 8080:80 nginxdemos/hello

.github/workflows/test-setup-e2e-environment-action.yml

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test-e2e-setup-action:
1114
runs-on: ubuntu-24.04
@@ -14,48 +17,48 @@ jobs:
1417
matrix:
1518
include:
1619
# no overwrites for images
17-
- ui-docker-image:
18-
hasura-docker-image:
19-
auth-docker-image:
20-
mbtiles-docker-image:
21-
jore3importer-docker-image:
22-
testdb-docker-image:
23-
mssqltestdb-docker-image:
24-
mapmatching-docker-image:
25-
mapmatchingdb-docker-image:
26-
cypress-docker-image:
27-
hastus-docker-image:
28-
custom-docker-compose:
20+
- ui-docker-image: ""
21+
hasura-docker-image: ""
22+
auth-docker-image: ""
23+
mbtiles-docker-image: ""
24+
jore3importer-docker-image: ""
25+
testdb-docker-image: ""
26+
mssqltestdb-docker-image: ""
27+
mapmatching-docker-image: ""
28+
mapmatchingdb-docker-image: ""
29+
cypress-docker-image: ""
30+
hastus-docker-image: ""
31+
custom-docker-compose: ""
2932
# overwrite some
3033
- ui-docker-image: "hsldevcom/jore4-ui:latest"
31-
hasura-docker-image:
32-
auth-docker-image:
33-
mbtiles-docker-image:
34-
jore3importer-docker-image:
35-
testdb-docker-image:
36-
mssqltestdb-docker-image:
37-
mapmatching-docker-image:
38-
mapmatchingdb-docker-image:
39-
cypress-docker-image:
40-
hastus-docker-image:
41-
custom-docker-compose:
34+
hasura-docker-image: ""
35+
auth-docker-image: ""
36+
mbtiles-docker-image: ""
37+
jore3importer-docker-image: ""
38+
testdb-docker-image: ""
39+
mssqltestdb-docker-image: ""
40+
mapmatching-docker-image: ""
41+
mapmatchingdb-docker-image: ""
42+
cypress-docker-image: ""
43+
hastus-docker-image: ""
44+
custom-docker-compose: ""
4245
# use custom docker-compose file
43-
- ui-docker-image:
44-
hasura-docker-image:
45-
auth-docker-image:
46-
mbtiles-docker-image:
47-
jore3importer-docker-image:
48-
testdb-docker-image:
49-
mssqltestdb-docker-image:
50-
mapmatching-docker-image:
51-
mapmatchingdb-docker-image:
52-
cypress-docker-image:
53-
hastus-docker-image:
46+
- ui-docker-image: ""
47+
hasura-docker-image: ""
48+
auth-docker-image: ""
49+
mbtiles-docker-image: ""
50+
jore3importer-docker-image: ""
51+
testdb-docker-image: ""
52+
mssqltestdb-docker-image: ""
53+
mapmatching-docker-image: ""
54+
mapmatchingdb-docker-image: ""
55+
cypress-docker-image: ""
56+
hastus-docker-image: ""
5457
custom-docker-compose: "custom-compose.yml" # this overwrites the hasura image to be "jore4-hasura:latest"
5558

5659
steps:
5760
- name: Checkout code
58-
uses: actions/checkout@v4
61+
uses: actions/checkout@v6
5962

6063
- name: Create a temporary custom docker compose file for testing
6164
run: |

0 commit comments

Comments
 (0)