File tree 1 file changed +14
-0
lines changed
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')"
40
40
INPUT_SKIP_EXISTING=" $( get-normalized-input ' skip-existing' ) "
41
41
INPUT_PRINT_HASH=" $( get-normalized-input ' print-hash' ) "
42
42
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
+
43
49
if [[ " ${INPUT_USER} " == " __token__" && -z " ${INPUT_PASSWORD} " ]] ; then
44
50
# No password supplied by the user implies that we're in the OIDC flow;
45
51
# retrieve the OIDC credential and exchange it for a PyPI API token.
@@ -53,10 +59,18 @@ elif [[ "${INPUT_USER}" == '__token__' ]]; then
53
59
echo \
54
60
' ::notice::Using a user-provided API token for authentication' \
55
61
" against ${INPUT_REPOSITORY_URL} "
62
+
63
+ if [[ " ${INPUT_REPOSITORY_URL} " =~ pypi\. org ]]; then
64
+ echo " ${TRUSTED_PUBLISHING_NUDGE} "
65
+ fi
56
66
else
57
67
echo \
58
68
' ::notice::Using a username + password pair for authentication' \
59
69
" against ${INPUT_REPOSITORY_URL} "
70
+
71
+ if [[ " ${INPUT_REPOSITORY_URL} " =~ pypi\. org ]]; then
72
+ echo " ${TRUSTED_PUBLISHING_NUDGE} "
73
+ fi
60
74
fi
61
75
62
76
if [[
You can’t perform that action at this time.
0 commit comments