Skip to content

Commit fcf1425

Browse files
committed
Merge branch 'release/2.1.0'
2 parents 7ce4c7a + d478be0 commit fcf1425

File tree

8 files changed

+20877
-4809
lines changed

8 files changed

+20877
-4809
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '16.x'
20+
- run: npm ci
21+
- run: npm run build
22+
- run: npm run ci:coverage
23+
- name: Coveralls
24+
uses: coverallsapp/github-action@master
25+
with:
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ develop, master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ develop ]
20+
schedule:
21+
- cron: '15 15 * * 2'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v1
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v1

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# serverless-plugin-deploy-environment
22
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)
33
[![Coverage Status](https://coveralls.io/repos/github/DopplerLabs/serverless-plugin-deploy-environment/badge.svg?branch=develop)](https://coveralls.io/github/DopplerLabs/serverless-plugin-deploy-environment?branch=develop)
4-
[![Build Status](https://travis-ci.org/DopplerLabs/serverless-plugin-deploy-environment.svg?branch=develop)](https://travis-ci.org/DopplerLabs/serverless-plugin-deploy-environment)
4+
![Build Status](https://github.com/jacob-meacham/serverless-plugin-deploy-environment/actions/workflows/ci.yml/badge.svg)
55

66
This plugin exposes per-stage deployment variables and deployment environment, and allows users to run commands with the environment of a given stage. The defined deployment environment is automatically merged with the serverless provider environment. It also optionally resolves [credstash](https://github.com/fugue/credstash) variables. The benefit of this is that its simpler to manage different variables for each environment, and makes the addition of default environment variables simple.
77

@@ -83,6 +83,8 @@ custom:
8383
Please note that because these are resolved at build time, the plain-text passwords WILL be viewable in Cloudformation and on the Lambda dashboard.
8484

8585
# Version History
86+
* 2.1.0
87+
- Fix merge mutation issue (Thanks @onhate!)
8688
* 2.0.2
8789
- Fix CLI warning (Thanks @onhate!)
8890
* 2.0.1

lib/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,18 @@ class ServerlessDeployEnvironment {
4343
options: {
4444
command: {
4545
usage: 'The command to run',
46-
shortcut: 'c'
46+
shortcut: 'c',
47+
type: 'string'
4748
},
4849
stage: {
4950
usage: 'The stage to use for stage-specific variables',
50-
shortcut: 's'
51+
shortcut: 's',
52+
type: 'string'
5153
},
5254
args: {
5355
usage: 'Extra arguments to pass through to the subprocess',
54-
shortcut: 'a'
56+
shortcut: 'a',
57+
type: 'multiple'
5558
}
5659
}
5760
}
@@ -125,11 +128,11 @@ class ServerlessDeployEnvironment {
125128
serverless.variables.loadVariableSyntax(); // Explicitly resolve these here, so that we can apply any transformations that we want
126129

127130
const vars = (0, _deasyncPromise.default)(serverless.variables.populateProperty(deployVariables, false));
128-
serverless.service.deployVariables = _lodash.default.merge(vars.default || {}, vars[stage]); // eslint-disable-line
131+
serverless.service.deployVariables = _lodash.default.merge({}, vars.default || {}, vars[stage]); // eslint-disable-line
129132

130133
const envs = (0, _deasyncPromise.default)(serverless.variables.populateProperty(deployEnvironment, false)); // eslint-disable-line
131134

132-
serverless.service.deployEnvironment = _lodash.default.merge(envs.default || {}, envs[stage]); // eslint-disable-line
135+
serverless.service.deployEnvironment = _lodash.default.merge({}, envs.default || {}, envs[stage]); // eslint-disable-line
133136
}
134137

135138
async _resolveDeployEnvironment() {
@@ -145,9 +148,8 @@ class ServerlessDeployEnvironment {
145148

146149
async _runWithEnvironment() {
147150
const deployEnv = await this._resolveDeployEnvironment();
148-
const env = {};
149151

150-
_lodash.default.merge(env, process.env, deployEnv); // Merge the current environment, overridden with the deploy environment
152+
const env = _lodash.default.merge({}, process.env, deployEnv); // Merge the current environment, overridden with the deploy environment
151153

152154

153155
const args = this.options.args || '';

0 commit comments

Comments
 (0)