diff --git a/download/dist/index.js b/download/dist/index.js index 0b08c35..09d8f17 100644 --- a/download/dist/index.js +++ b/download/dist/index.js @@ -2694,9 +2694,21 @@ function getResultsServiceUrl() { if (!resultsUrl) { throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable'); } - return new URL(resultsUrl).origin; + const serviceUrl = new URL(resultsUrl); + if (serviceUrl.protocol === 'https:' && isDockerBridgeIPv4(serviceUrl.hostname)) { + serviceUrl.protocol = 'http:'; + } + return serviceUrl.origin; } exports.getResultsServiceUrl = getResultsServiceUrl; +function isDockerBridgeIPv4(hostname) { + const octets = hostname.split('.').map(Number); + return (octets.length === 4 && + octets.every(octet => Number.isInteger(octet) && octet >= 0 && octet <= 255) && + octets[0] === 172 && + octets[1] >= 16 && + octets[1] <= 31); +} function isGhes() { return false; } @@ -124958,4 +124970,4 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"] /******/ module.exports = __webpack_exports__; /******/ /******/ })() -; \ No newline at end of file +; diff --git a/upload/dist/index.js b/upload/dist/index.js index 1acca9b..30783f1 100644 --- a/upload/dist/index.js +++ b/upload/dist/index.js @@ -3019,9 +3019,21 @@ function getResultsServiceUrl() { if (!resultsUrl) { throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable'); } - return new URL(resultsUrl).origin; + const serviceUrl = new URL(resultsUrl); + if (serviceUrl.protocol === 'https:' && isDockerBridgeIPv4(serviceUrl.hostname)) { + serviceUrl.protocol = 'http:'; + } + return serviceUrl.origin; } exports.getResultsServiceUrl = getResultsServiceUrl; +function isDockerBridgeIPv4(hostname) { + const octets = hostname.split('.').map(Number); + return (octets.length === 4 && + octets.every(octet => Number.isInteger(octet) && octet >= 0 && octet <= 255) && + octets[0] === 172 && + octets[1] >= 16 && + octets[1] <= 31); +} function isGhes() { return false; } @@ -129412,4 +129424,4 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"] /******/ module.exports = __webpack_exports__; /******/ /******/ })() -; \ No newline at end of file +;