Skip to content

Commit 8adec2b

Browse files
committed
ci: grant id-token permission for PyPI publish
Made-with: Cursor
1 parent 6f4d94a commit 8adec2b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
default: false
1818
type: boolean
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
test:
2225
name: Test (Python ${{ matrix.python-version }})
@@ -66,6 +69,10 @@ jobs:
6669
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_pypi == 'true')
6770
)
6871
72+
permissions:
73+
contents: read
74+
id-token: write
75+
6976
steps:
7077
- uses: actions/checkout@v4
7178

@@ -82,4 +89,7 @@ jobs:
8289
- name: Publish to PyPI
8390
uses: pypa/gh-action-pypi-publish@release/v1
8491
with:
92+
# If PYPI_API_TOKEN is set, token-based upload is used.
93+
# If it's missing, the action falls back to trusted publishing (OIDC),
94+
# which requires `id-token: write` permissions.
8595
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)