Skip to content

Commit 49f4e29

Browse files
committed
chore: add permissions to workflows run
1 parent 25f3226 commit 49f4e29

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: release
13+
permissions:
14+
id-token: write
1115
steps:
1216
- uses: actions/checkout@v5
13-
14-
- name: Install uv with python
15-
uses: astral-sh/setup-uv@v7
1617
with:
18+
persist-credentials: false
19+
- uses: astral-sh/setup-uv@v7
20+
with:
21+
enable-cache: false
1722
python-version: "3.12"
18-
enable-cache: true
19-
20-
- name: Set version from tag
21-
run: uv version "${{ github.ref_name }}"
22-
23-
- name: Build artifacts
24-
run: uv build
25-
26-
- name: Publish package
27-
run: uv publish --token "${{ secrets.PYPI_TOKEN }}"
23+
version: "latest"
24+
- run: uv version "${GITHUB_REF_NAME}"
25+
- run: uv build
26+
- name: Release package
27+
env:
28+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
29+
run: uv publish

.github/workflows/test.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,30 @@ on:
88
paths-ignore:
99
- '*.md'
1010

11+
permissions:
12+
actions: read
13+
contents: read
14+
pull-requests: read
15+
1116

1217
jobs:
1318
lint:
1419
strategy:
1520
matrix:
16-
cmd: ["black", "mypy", "ruff"]
21+
cmd: ["black", "ruff", "mypy"]
1722
runs-on: ubuntu-latest
1823
steps:
1924
- uses: actions/checkout@v5
20-
21-
22-
- name: Install uv with python
25+
with:
26+
persist-credentials: false
27+
- id: setup-uv
2328
uses: astral-sh/setup-uv@v7
2429
with:
25-
python-version: "3.12"
2630
enable-cache: true
27-
28-
29-
- name: Install dependencies
31+
cache-suffix: 3.11
32+
version: "latest"
33+
python-version: 3.11
34+
- name: Install deps
3035
run: uv sync --all-extras
31-
3236
- name: Run lint check
3337
run: uv run pre-commit run -a ${{ matrix.cmd }}

0 commit comments

Comments
 (0)