From 1350b8bd724c983bdf030b52cba047a6eea5dc6d Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 6 Dec 2022 21:40:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Avoid=20broken=20env=20vars=20pa?= =?UTF-8?q?ssed=20by=20GHA=20from=20host?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/pypa/gh-action-pypi-publish/issues/112. --- twine-upload.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/twine-upload.sh b/twine-upload.sh index 829f39a..c796ebe 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -2,6 +2,13 @@ set -Eeuo pipefail +# NOTE: These variables are needed to combat GitHub passing broken env vars +# NOTE: from the runner VM host runtime. +# Ref: https://github.com/pypa/gh-action-pypi-publish/issues/112 +export PATH="$(python -m site --user-base)/bin:${PATH}" +export PYTHONPATH="$(python -m site --user-site):${PYTHONPATH}" + + if [[ "$INPUT_USER" == "__token__" && ! "$INPUT_PASSWORD" =~ ^pypi-