Skip to content

Commit d6fa7cb

Browse files
authored
ci(publish): pin pypa/gh-action-pypi-publish to v1.0.6 to avoid tag r… (#36)
1 parent e1e8967 commit d6fa7cb

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33
name: Upload Python Package
44

5+
permissions:
6+
id-token: write
7+
contents: read
8+
59
"on":
610
release:
711
types:
@@ -10,6 +14,9 @@ name: Upload Python Package
1014
jobs:
1115
deploy:
1216
runs-on: ubuntu-latest
17+
permissions:
18+
id-token: write
19+
contents: read
1320

1421
steps:
1522
- name: Checkout
@@ -25,9 +32,11 @@ jobs:
2532
python -m pip install --upgrade build
2633
python -m build
2734
- name: Publish package to PyPI
28-
# Pin to a specific released version to avoid resolving issues with
29-
# floating tags. Using v1.0.6 which is a stable release at time of
30-
# update; adjust if newer stable tag is preferred.
31-
uses: pypa/gh-action-pypi-publish@v1.0.6
32-
with:
33-
password: ${{ secrets.PYPI_TOKEN }}
35+
# Use the action's release branch to follow the stable v1 releases.
36+
# The action recommends `release/v1` or a specific tag; `release/v1`
37+
# will resolve to the latest v1.x release.
38+
# With `permissions.id-token: write` and a configured trusted repository
39+
# on PyPI, the action will use OIDC token-based authentication and
40+
# no repository secret is required. If you prefer an API token, add
41+
# `password: ${{ secrets.PYPI_TOKEN }}` under `with` instead.
42+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)