changed CORS permissions
Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline is pending
ci/woodpecker/push/ledger Pipeline is pending
ci/woodpecker/push/nats Pipeline is pending
ci/woodpecker/push/notification Pipeline is pending
ci/woodpecker/push/payments_orchestrator Pipeline is pending
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline failed
ci/woodpecker/push/bump_version unknown status
ci/woodpecker/push/frontend Pipeline failed

This commit is contained in:
Stephan D
2025-11-18 02:25:50 +01:00
parent e1f6f10114
commit df81a93838
2 changed files with 26 additions and 3 deletions

View File

@@ -67,9 +67,33 @@ if [ -z "${BRANCH}" ] || [ "${BRANCH}" = "HEAD" ]; then
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
fi
REMOTE_URL="${CI_REPO_REMOTE:-${WOODPECKER_GIT_REMOTE:-${DRONE_REMOTE_URL:-}}}"
if [ -z "${REMOTE_URL}" ]; then
REMOTE_URL="$(git config --get remote.origin.url 2>/dev/null || true)"
fi
# Normalize machine to a bare hostname so .netrc matches HTTPS requests.
normalize_machine() {
value="$1"
if [ -z "${value}" ]; then
printf '%s' ""
return
fi
printf '%s' "${value}" | sed -E '
s#^[[:alpha:]][[:alnum:]+.-]*://##;
s#^[^@]*@##;
s#/.*$##;
'
}
NETRC_MACHINE="${CI_NETRC_MACHINE:-${WOODPECKER_NETRC_MACHINE:-${DRONE_NETRC_MACHINE:-}}}"
NETRC_USERNAME="${CI_NETRC_USERNAME:-${WOODPECKER_NETRC_USERNAME:-${DRONE_NETRC_USERNAME:-${CI_NETRC_LOGIN:-${WOODPECKER_NETRC_LOGIN:-${DRONE_NETRC_LOGIN:-}}}}}}"
NETRC_PASSWORD="${CI_NETRC_PASSWORD:-${WOODPECKER_NETRC_PASSWORD:-${DRONE_NETRC_PASSWORD:-}}}"
NETRC_MACHINE="$(normalize_machine "${NETRC_MACHINE}")"
if [ -z "${NETRC_MACHINE}" ] && [ -n "${REMOTE_URL}" ]; then
NETRC_MACHINE="$(normalize_machine "${REMOTE_URL}")"
fi
if [ -n "${NETRC_MACHINE}" ] && [ -n "${NETRC_USERNAME}" ] && [ -n "${NETRC_PASSWORD}" ]; then
NETRC_FILE="${HOME:-/root}/.netrc"
{
@@ -81,7 +105,6 @@ if [ -n "${NETRC_MACHINE}" ] && [ -n "${NETRC_USERNAME}" ] && [ -n "${NETRC_PASS
echo "[bump-version] configured credentials for ${NETRC_MACHINE}"
fi
REMOTE_URL="${CI_REPO_REMOTE:-${WOODPECKER_GIT_REMOTE:-${DRONE_REMOTE_URL:-}}}"
if [ -n "${REMOTE_URL}" ]; then
git remote set-url origin "${REMOTE_URL}"
fi