diff --git a/src/setup-python.ts b/src/setup-python.ts index 132c42f1..104d93f2 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -164,8 +164,12 @@ async function run() { if (pypiUrl) { const pypiUsername = core.getInput('pypi-username'); const pypiPassword = core.getInput('pypi-password'); - core.setSecret(pypiUsername); - core.setSecret(pypiPassword); + if (pypiUsername && pypiUsername.trim()) { + core.setSecret(pypiUsername); + } + if (pypiPassword && pypiPassword.trim()) { + core.setSecret(pypiPassword); + } await configurePipRepository(pypiUrl, pypiUsername, pypiPassword); } const pipInstall = core.getInput('pip-install');