Skip to content

Commit a01bbfa

Browse files
authored
CI: Restrict default permissions on GitHub Actions workflows (OSGeo#4942)
1 parent 4af7d72 commit a01bbfa

12 files changed

+42
-7
lines changed

.github/workflows/additional_checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
1818
cancel-in-progress: true
1919

20+
permissions: {}
21+
2022
jobs:
2123
additional-checks:
2224
name: Additional checks

.github/workflows/docker.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ on:
2222
release:
2323
types: [published]
2424

25-
jobs:
25+
permissions: {}
2626

27+
jobs:
2728
# Run for push to configured branches and all published releases.
2829
# Take care of different os.
2930
# For main branch, created tags are:
@@ -47,6 +48,10 @@ jobs:
4748
- ubuntu_wxgui
4849
fail-fast: false
4950

51+
permissions:
52+
contents: read
53+
packages: write
54+
5055
steps:
5156
- name: Checkout
5257
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/gcc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- releasebranch_*
99
pull_request:
1010

11+
permissions: {}
12+
1113
jobs:
1214
build:
1315
name: ${{ matrix.c }} & ${{ matrix.cpp }}

.github/workflows/macos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414
concurrency:
1515
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
1616
cancel-in-progress: true
17+
18+
permissions: {}
19+
1720
jobs:
1821
macos_build:
1922
name: macOS build

.github/workflows/milestones.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ on:
55
pull_request_target:
66
types: [closed]
77

8+
permissions: {}
9+
810
jobs:
911
assign-milestone:
1012
runs-on: ubuntu-latest
1113
if: github.event.pull_request.merged
14+
permissions:
15+
contents: read
16+
pull-requests: write
1217
steps:
13-
# Retreiving the current milestoone from API instead of github context,
18+
# Retrieving the current milestone from API instead of github context,
1419
# so up-to-date information is used when running after being queued or for reruns
1520
# Otherwise, the information should be available using
1621
# ${{ github.event.pull_request.milestone.title }}

.github/workflows/osgeo4w.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- releasebranch_*
99
pull_request:
1010

11+
permissions: {}
12+
1113
jobs:
1214
build:
1315
name: ${{ matrix.os }} build and tests

.github/workflows/periodic_update.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ on:
1010
# See https://crontab.guru/#32_10_*/100,1-7_*_WED
1111
- cron: "32 10 */100,1-7 * WED"
1212

13+
permissions: {}
14+
1315
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1416
jobs:
1517
update-configure:
1618
# The type of runner that the job will run on
1719
runs-on: ubuntu-latest
1820

21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
1925
# Steps represent a sequence of tasks that will be executed as part of the job
2026
steps:
2127
- name: Create URL to the run output

.github/workflows/pytest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- releasebranch_*
99
pull_request:
1010

11+
permissions: {}
12+
1113
jobs:
1214
pytest:
1315
concurrency:

.github/workflows/python-code-quality.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- releasebranch_*
99
pull_request:
1010

11+
permissions: {}
12+
1113
jobs:
1214
python-checks:
1315
name: Python Code Quality Checks

.github/workflows/super-linter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
1313
cancel-in-progress: true
1414

15+
permissions: {}
16+
1517
jobs:
1618
super-linter:
1719
name: GitHub Super Linter

0 commit comments

Comments
 (0)