Skip to content

Commit 038bf37

Browse files
committed
update to pypi trusted publisher
1 parent 0a3822f commit 038bf37

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/code.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ jobs:
112112
needs: [lint, dist, test]
113113
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
114114
runs-on: ubuntu-latest
115-
env:
116-
HAS_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN != '' }}
115+
permissions:
116+
# this permission is mandatory for trusted publishing To PyPI
117+
id-token: write
118+
# Specify the GitHub Environment to publish to
119+
environment: release
117120

118121
steps:
119122
- uses: actions/download-artifact@v3
@@ -136,7 +139,4 @@ jobs:
136139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137140

138141
- name: Publish to PyPI
139-
if: ${{ env.HAS_PYPI_TOKEN }}
140142
uses: pypa/gh-action-pypi-publish@release/v1
141-
with:
142-
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)