File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ INPUT_VERIFY_METADATA="$(get-normalized-input 'verify-metadata')"
4040INPUT_SKIP_EXISTING=" $( get-normalized-input ' skip-existing' ) "
4141INPUT_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+
4349if [[ " ${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,18 @@ elif [[ "${INPUT_USER}" == '__token__' ]]; then
5359 echo \
5460 ' ::notice::Using a user-provided API token for authentication' \
5561 " against ${INPUT_REPOSITORY_URL} "
62+
63+ if [[ " ${INPUT_REPOSITORY_URL} " =~ pypi\. org ]]; then
64+ echo " ${TRUSTED_PUBLISHING_NUDGE} "
65+ fi
5666else
5767 echo \
5868 ' ::notice::Using a username + password pair for authentication' \
5969 " against ${INPUT_REPOSITORY_URL} "
70+
71+ if [[ " ${INPUT_REPOSITORY_URL} " =~ pypi\. org ]]; then
72+ echo " ${TRUSTED_PUBLISHING_NUDGE} "
73+ fi
6074fi
6175
6276if [[
You can’t perform that action at this time.
0 commit comments