Skip to content

Commit 25d1c17

Browse files
ci: add GitHub token permissions for workflows (#47652)
* ci: add GitHub token permissions for workflows Signed-off-by: Varun Sharma <[email protected]> * trim trailing whitespace Signed-off-by: Varun Sharma <[email protected]> * Update stale-pr.yml Signed-off-by: Varun Sharma <[email protected]>
1 parent ae1d859 commit 25d1c17

11 files changed

+45
-0
lines changed

.github/workflows/32-bit-linux.yml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
paths-ignore:
1313
- "doc/**"
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
pytest:
1720
runs-on: ubuntu-latest

.github/workflows/assign.yml

+6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ on:
33
issue_comment:
44
types: created
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
issue_assign:
11+
permissions:
12+
issues: write
13+
pull-requests: write
814
runs-on: ubuntu-latest
915
steps:
1016
- if: github.event.comment.body == 'take'

.github/workflows/asv-bot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ env:
99
ENV_FILE: environment.yml
1010
COMMENT: ${{github.event.comment.body}}
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
autotune:
17+
permissions:
18+
contents: read
19+
issues: write
20+
pull-requests: write
1421
name: "Run benchmarks"
1522
# TODO: Support more benchmarking options later, against different branches, against self, etc
1623
if: startsWith(github.event.comment.body, '@github-actions benchmark')

.github/workflows/autoupdate-pre-commit-config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55
- cron: "0 7 1 * *" # At 07:00 on 1st of every month.
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
update-pre-commit:
13+
permissions:
14+
contents: write # for technote-space/create-pr-action to push code
15+
pull-requests: write # for technote-space/create-pr-action to create a PR
1016
if: github.repository_owner == 'pandas-dev'
1117
name: Autoupdate pre-commit config
1218
runs-on: ubuntu-latest

.github/workflows/code-checks.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414
ENV_FILE: environment.yml
1515
PANDAS_CI: 1
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
pre_commit:
1922
name: pre-commit

.github/workflows/docbuild-and-upload.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414
ENV_FILE: environment.yml
1515
PANDAS_CI: 1
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
web_and_docs:
1922
name: Doc Build and Upload

.github/workflows/macos-windows.yml

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ env:
1818
PATTERN: "not slow and not db and not network and not single_cpu"
1919

2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
pytest:
2326
defaults:

.github/workflows/python-dev.yml

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ env:
2727
COVERAGE: true
2828
PYTEST_TARGET: pandas
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
build:
3235
if: false # Comment this line out to "unfreeze"

.github/workflows/sdist.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
paths-ignore:
1414
- "doc/**"
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
build:
1821
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}

.github/workflows/stale-pr.yml

+5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ on:
44
# * is a special character in YAML so you have to quote this string
55
- cron: "0 0 * * *"
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
stale:
12+
permissions:
13+
pull-requests: write
914
runs-on: ubuntu-latest
1015
steps:
1116
- uses: actions/stale@v4

.github/workflows/ubuntu.yml

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
env:
1616
PANDAS_CI: 1
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
pytest:
2023
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)