Skip to content

Commit

Permalink
Merge pull request #154 from epics-containers/pypi-trusted
Browse files Browse the repository at this point in the history
switch to trusted publisher for PyPI
  • Loading branch information
gilesknap authored Dec 15, 2023
2 parents 843d083 + 3723e23 commit 8804869
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ jobs:
needs: [lint, dist, test]
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest
env:
HAS_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN != '' }}
permissions:
# this permission is mandatory for trusted publishing To PyPI
id-token: write
contents: write
# Specify the GitHub Environment to publish to
environment: release

steps:
- name: Checkout
Expand Down Expand Up @@ -146,7 +150,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

0 comments on commit 8804869

Please sign in to comment.