Skip to content

Commit 202d7af

Browse files
epaganonmichaelmcdonnellmw
authored andcommitted
Sets minimal set of workflow permissions
1 parent 9c0797e commit 202d7af

6 files changed

Lines changed: 38 additions & 11 deletions

.github/workflows/build-test-publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022-2025 The MathWorks, Inc.
1+
# Copyright 2022-2026 The MathWorks, Inc.
22

33
name: Build, Test and Publish the Dockerfile
44

@@ -7,7 +7,7 @@ name: Build, Test and Publish the Dockerfile
77
on:
88
workflow_dispatch:
99
push:
10-
# Trigger the workflow is the Dockerfile or any file under tests/ is modified
10+
# Trigger the workflow when the Dockerfile or any file under tests/ is modified
1111
paths:
1212
- "Dockerfile"
1313
- "tests/*"
@@ -25,6 +25,11 @@ env:
2525
jobs:
2626
build-test-push-image:
2727
runs-on: ubuntu-latest
28+
29+
permissions:
30+
contents: read
31+
packages: write
32+
2833
strategy:
2934
fail-fast: false
3035
matrix:
@@ -82,9 +87,9 @@ jobs:
8287
run: echo '${{ secrets.MATLAB_LICENSE_FILE }}' > ${{ env.LICENSE_FILE_PATH }}
8388

8489
- name: Test container
90+
working-directory: tests
8591
env:
8692
IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
87-
working-directory: tests
8893
run: python -m unittest -v
8994

9095
- name: Push the image to ghcr.io

.github/workflows/from-matlab-docker-build-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023-2025 The MathWorks, Inc.
1+
# Copyright 2023-2026 The MathWorks, Inc.
22

33
name: Build and Test the "Building on MATLAB Docker Image" Dockerfile
44

@@ -26,6 +26,10 @@ env:
2626
jobs:
2727
build-test-image:
2828
runs-on: ubuntu-latest
29+
30+
permissions:
31+
contents: read
32+
2933
strategy:
3034
fail-fast: false
3135
matrix:

.github/workflows/matlab-container-offline-install-build-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024-2025 The MathWorks, Inc.
1+
# Copyright 2024-2026 The MathWorks, Inc.
22

33
name: Build and Test the "MATLAB Container Offline Install" Dockerfiles
44

@@ -29,6 +29,10 @@ env:
2929
jobs:
3030
build-test-image:
3131
runs-on: ubuntu-latest
32+
33+
permissions:
34+
contents: read
35+
3236
strategy:
3337
fail-fast: false
3438
matrix:

.github/workflows/matlab-installer-build-test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023-2025 The MathWorks, Inc.
1+
# Copyright 2023-2026 The MathWorks, Inc.
22

33
name: Build and Test the "MATLAB installer" Dockerfile
44

@@ -25,6 +25,10 @@ env:
2525
jobs:
2626
build-test-image:
2727
runs-on: ubuntu-latest
28+
29+
permissions:
30+
contents: read
31+
2832
defaults:
2933
run:
3034
shell: bash
@@ -47,7 +51,7 @@ jobs:
4751
steps:
4852
- name: Checkout repo
4953
uses: actions/checkout@v4
50-
54+
5155
- name: Cleanup runner
5256
uses: ./.github/actions/cleanup-runner
5357

.github/workflows/non-interactive-build-test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Copyright 2024-2025 The MathWorks, Inc.
1+
# Copyright 2024-2026 The MathWorks, Inc.
22

3-
name: Build and Test the "Non-Interactive" Dockerfile
3+
name: Build, Test and Publish the "Non-Interactive" Dockerfile
44

55
# Trigger this workflow either manually or when a new change is pushed to the
66
# repo (except .md files)
@@ -23,8 +23,13 @@ env:
2323
ALT_PATH: alternates/non-interactive
2424

2525
jobs:
26-
build-test-image:
26+
build-test-push-image:
2727
runs-on: ubuntu-latest
28+
29+
permissions:
30+
contents: read
31+
packages: write
32+
2833
strategy:
2934
fail-fast: false
3035
matrix:

.github/workflows/windows-container-build-test-publish.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2025 The MathWorks, Inc.
1+
# Copyright 2025-2026 The MathWorks, Inc.
22

33
name: Build, Test and Publish the Windows Dockerfile
44

@@ -24,6 +24,11 @@ env:
2424
jobs:
2525
windows-container-build-test-push-image:
2626
runs-on: windows-2022
27+
28+
permissions:
29+
contents: read
30+
packages: write
31+
2732
strategy:
2833
fail-fast: false
2934
matrix:

0 commit comments

Comments
 (0)