Skip to content

Commit ad98346

Browse files
committed
Fix publish workflow secret gating for dispatch/release
1 parent d6867ad commit ad98346

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
permissions:
5353
id-token: write
5454
contents: read
55+
env:
56+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
5557
steps:
5658
- name: Download dist artifacts
5759
uses: actions/download-artifact@v4
@@ -60,12 +62,12 @@ jobs:
6062
path: dist
6163

6264
- name: Publish package to PyPI (token)
63-
if: ${{ secrets.PYPI_API_TOKEN != '' }}
65+
if: ${{ env.PYPI_API_TOKEN != '' }}
6466
uses: pypa/gh-action-pypi-publish@release/v1
6567
with:
6668
user: __token__
67-
password: ${{ secrets.PYPI_API_TOKEN }}
69+
password: ${{ env.PYPI_API_TOKEN }}
6870

6971
- name: Publish package to PyPI (trusted publishing)
70-
if: ${{ secrets.PYPI_API_TOKEN == '' }}
72+
if: ${{ env.PYPI_API_TOKEN == '' }}
7173
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)