Skip to content

Commit b66f8c4

Browse files
523034406523034406
authored andcommitted
fix(ci): remove GitHub Environment from PyPI job for OIDC trusted publisher
PyPI must list the same environment name when using environment: pypi; default Trusted Publisher setup is repo + workflow only. Made-with: Cursor
1 parent c88fcc3 commit b66f8c4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ jobs:
99
build-and-publish:
1010
name: Build & Publish
1111
runs-on: ubuntu-latest
12-
environment: pypi
12+
# 勿在此使用 environment: xxx,除非你在 PyPI Trusted Publisher 里填写了同名 GitHub Environment;
13+
# 否则 OIDC sub 会带 :environment:xxx,与 PyPI 配置不一致 → invalid-publisher。
1314
permissions:
14-
id-token: write # 使用 OIDC 免密发布(推荐
15+
id-token: write # OIDC → PyPI Trusted Publisher(见 https://docs.pypi.org/trusted-publishers/
1516

1617
steps:
1718
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)