diff --git a/CHANGELOG.md b/CHANGELOG.md index b6a76d8..19e314a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [1.4.0](https://github.com/sws2apps/render-deployment/compare/v1.3.0...v1.4.0) (2023-07-26) + + +### Features + +* **deps:** bump dotenv from 16.1.4 to 16.3.0 ([930c04e](https://github.com/sws2apps/render-deployment/commit/930c04e5253874590dc978e6474bb49417a080a9)) +* **deps:** bump dotenv from 16.3.0 to 16.3.1 ([6f6bb28](https://github.com/sws2apps/render-deployment/commit/6f6bb28c7e8fa04c19cb2b201643d0ff47889e01)) +* **deps:** bump node-fetch from 3.3.1 to 3.3.2 ([40815c5](https://github.com/sws2apps/render-deployment/commit/40815c5a05ee45a0b9adc35285f01462f47de29e)) + # [1.3.0](https://github.com/sws2apps/render-deployment/compare/v1.2.0...v1.3.0) (2023-06-15) diff --git a/dist/index.js b/dist/index.js index 6f1ede8..f0efb85 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1771,7 +1771,7 @@ exports.checkBypass = checkBypass; /***/ 5478: /***/ ((module) => { -const re = /^dotenv_config_(encoding|path|debug|override)=(.+)$/ +const re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/ module.exports = function optionMatcher (args) { return args.reduce(function (acc, cur) { @@ -1808,6 +1808,10 @@ if (process.env.DOTENV_CONFIG_OVERRIDE != null) { options.override = process.env.DOTENV_CONFIG_OVERRIDE } +if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) { + options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY +} + module.exports = options @@ -1876,7 +1880,7 @@ function _parseVault (options) { // handle scenario for comma separated keys - for use with key rotation // example: DOTENV_KEY="dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod" - const keys = _dotenvKey().split(',') + const keys = _dotenvKey(options).split(',') const length = keys.length let decrypted @@ -1917,11 +1921,18 @@ function _debug (message) { console.log(`[dotenv@${version}][DEBUG] ${message}`) } -function _dotenvKey () { +function _dotenvKey (options) { + // prioritize developer directly setting options.DOTENV_KEY + if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) { + return options.DOTENV_KEY + } + + // secondary infra already contains a DOTENV_KEY environment variable if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { return process.env.DOTENV_KEY } + // fallback to empty string return '' } @@ -1980,7 +1991,12 @@ function _configVault (options) { const parsed = DotenvModule._parseVault(options) - DotenvModule.populate(process.env, parsed, options) + let processEnv = process.env + if (options && options.processEnv != null) { + processEnv = options.processEnv + } + + DotenvModule.populate(processEnv, parsed, options) return { parsed } } @@ -2003,7 +2019,12 @@ function configDotenv (options) { // Specifying an encoding returns a string instead of a buffer const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding })) - DotenvModule.populate(process.env, parsed, options) + let processEnv = process.env + if (options && options.processEnv != null) { + processEnv = options.processEnv + } + + DotenvModule.populate(processEnv, parsed, options) return { parsed } } catch (e) { @@ -2020,7 +2041,7 @@ function config (options) { const vaultPath = _vaultPath(options) // fallback to original dotenv if DOTENV_KEY is not set - if (_dotenvKey().length === 0) { + if (_dotenvKey(options).length === 0) { return DotenvModule.configDotenv(options) } @@ -7938,7 +7959,7 @@ return new B(c,{type:"multipart/form-data; boundary="+b})} /***/ 9968: /***/ ((module) => { -module.exports = JSON.parse('{"name":"dotenv","version":"16.1.4","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"funding":"https://github.com/motdotla/dotenv?sponsor=1","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3","decache":"^4.6.1","sinon":"^14.0.1","standard":"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0","tap":"^16.3.0","tar":"^6.1.11","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}'); +module.exports = JSON.parse('{"name":"dotenv","version":"16.3.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"funding":"https://github.com/motdotla/dotenv?sponsor=1","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3","decache":"^4.6.1","sinon":"^14.0.1","standard":"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0","tap":"^16.3.0","tar":"^6.1.11","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}'); /***/ }) @@ -9793,10 +9814,6 @@ const getNodeRequestOptions = request => { agent = agent(parsedURL); } - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - // HTTP-network fetch step 4.2 // chunked encoding is handled by Node.js diff --git a/package.json b/package.json index f7476d1..ef1547a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "render-deployment", "description": "A GitHub Action to trigger deployment in Render.", - "version": "1.3.0", + "version": "1.4.0", "private": true, "type": "module", "homepage": "https://github.com/sws2apps/render-deployment#readme",