Skip to content

Commit be69596

Browse files
committed
twine-upload: add a nudge for trusted publishing
Closes #164. Signed-off-by: William Woodruff <[email protected]>
1 parent 54d67ed commit be69596

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

twine-upload.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ INPUT_VERIFY_METADATA="$(get-normalized-input 'verify-metadata')"
4040
INPUT_SKIP_EXISTING="$(get-normalized-input 'skip-existing')"
4141
INPUT_PRINT_HASH="$(get-normalized-input 'print-hash')"
4242

43+
TRUSTED_PUBLISHING_NUDGE="::warning title=Upgrade to Trusted Publishing::\
44+
Trusted Publishers allows publishing packages to PyPI from automated \
45+
environments like GitHub Actions without needing to use username/password \
46+
combinations or API tokens to authenticate with PyPI. Read more: \
47+
https://docs.pypi.org/trusted-publishers"
48+
4349
if [[ "${INPUT_USER}" == "__token__" && -z "${INPUT_PASSWORD}" ]] ; then
4450
# No password supplied by the user implies that we're in the OIDC flow;
4551
# retrieve the OIDC credential and exchange it for a PyPI API token.
@@ -53,10 +59,12 @@ elif [[ "${INPUT_USER}" == '__token__' ]]; then
5359
echo \
5460
'::notice::Using a user-provided API token for authentication' \
5561
"against ${INPUT_REPOSITORY_URL}"
62+
echo "${TRUSTED_PUBLISHING_NUDGE}"
5663
else
5764
echo \
5865
'::notice::Using a username + password pair for authentication' \
5966
"against ${INPUT_REPOSITORY_URL}"
67+
echo "${TRUSTED_PUBLISHING_NUDGE}"
6068
fi
6169

6270
if [[

0 commit comments

Comments
 (0)