Skip to content

Commit 03581cd

Browse files
committed
chore: Add permissions to all workflows
1 parent 2515608 commit 03581cd

File tree

5 files changed

+39
-24
lines changed

5 files changed

+39
-24
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
lint:
1114
runs-on: ubuntu-latest

.github/workflows/pr_title.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- edited
88
- synchronize
99

10+
permissions:
11+
pull-requests: read
12+
1013
jobs:
1114
main:
1215
name: Validate PR title
@@ -44,7 +47,7 @@ jobs:
4447
# special "[WIP]" prefix to indicate this state. This will avoid the
4548
# validation of the PR title and the pull request checks remain pending.
4649
# Note that a second check will be reported if this is enabled.
47-
wip: true
50+
wip: false
4851
# When using "Squash and merge" on a PR with only one commit, GitHub
4952
# will suggest using that commit message instead of the PR title for the
5053
# merge commit, and it's easy to commit this by mistake. Enable this option

.github/workflows/publish.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,30 @@ name: publish
22
on:
33
push:
44
tags:
5-
- 'v*.*.*'
5+
- "v*.*.*"
6+
7+
permissions:
8+
contents: read
69

710
jobs:
8-
pypi-publish:
9-
name: upload release to PyPI
10-
runs-on: ubuntu-latest
11-
permissions:
12-
# IMPORTANT: this permission is mandatory for trusted publishing
13-
id-token: write
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v5
17-
- name: Set up Python
18-
uses: actions/setup-python@v5
19-
with:
20-
python-version: '3.13'
21-
- name: Install dependencies
22-
run: |
23-
pip install -r requirements.txt
24-
pip install build
25-
- name: Build package
26-
run: python -m build
27-
- name: Publish package distributions to PyPI
28-
uses: pypa/gh-action-pypi-publish@release/v1
11+
pypi-publish:
12+
name: upload release to PyPI
13+
runs-on: ubuntu-latest
14+
permissions:
15+
# IMPORTANT: this permission is mandatory for trusted publishing
16+
id-token: write
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v5
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.13"
24+
- name: Install dependencies
25+
run: |
26+
pip install -r requirements.txt
27+
pip install build
28+
- name: Build package
29+
run: python -m build
30+
- name: Publish package distributions to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release_pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches:
55
- main
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
release-please:
912
runs-on: ubuntu-latest

.github/workflows/unittest.yml

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

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
timeout-minutes: 30
@@ -16,7 +19,7 @@ jobs:
1619
- name: Set up Python
1720
uses: actions/setup-python@v5
1821
with:
19-
python-version: '3.13'
22+
python-version: "3.13"
2023
- name: Install dependencies
2124
run: |
2225
pip install --upgrade pip

0 commit comments

Comments
 (0)