semantic-release 15.9.8 → 15.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,7 @@
1
1
  const {isString, isPlainObject} = require('lodash');
2
2
  const {gitHead} = require('../git');
3
+ const hideSensitive = require('../hide-sensitive');
4
+ const {hideSensitiveValues} = require('../utils');
3
5
  const {RELEASE_TYPE, RELEASE_NOTES_SEPARATOR} = require('./constants');
4
6
 
5
7
  module.exports = {
@@ -40,7 +42,7 @@ module.exports = {
40
42
  },
41
43
  }),
42
44
  }),
43
- postprocess: results => results.filter(Boolean).join(RELEASE_NOTES_SEPARATOR),
45
+ postprocess: (results, {env}) => hideSensitive(env)(results.filter(Boolean).join(RELEASE_NOTES_SEPARATOR)),
44
46
  },
45
47
  prepare: {
46
48
  default: ['@semantic-release/npm'],
@@ -80,11 +82,13 @@ module.exports = {
80
82
  multiple: true,
81
83
  required: false,
82
84
  pipelineConfig: () => ({settleAll: true}),
85
+ preprocess: ({releases, env, ...inputs}) => ({...inputs, env, releases: hideSensitiveValues(env, releases)}),
83
86
  },
84
87
  fail: {
85
88
  default: ['@semantic-release/github'],
86
89
  multiple: true,
87
90
  required: false,
88
91
  pipelineConfig: () => ({settleAll: true}),
92
+ preprocess: ({errors, env, ...inputs}) => ({...inputs, env, errors: hideSensitiveValues(env, errors)}),
89
93
  },
90
94
  };
@@ -1,4 +1,4 @@
1
- const {escapeRegExp, size} = require('lodash');
1
+ const {escapeRegExp, size, isString} = require('lodash');
2
2
  const {SECRET_REPLACEMENT, SECRET_MIN_SIZE} = require('./definitions/constants');
3
3
 
4
4
  module.exports = env => {
@@ -7,5 +7,6 @@ module.exports = env => {
7
7
  );
8
8
 
9
9
  const regexp = new RegExp(toReplace.map(envVar => escapeRegExp(env[envVar])).join('|'), 'g');
10
- return output => (output && toReplace.length > 0 ? output.toString().replace(regexp, SECRET_REPLACEMENT) : output);
10
+ return output =>
11
+ output && isString(output) && toReplace.length > 0 ? output.toString().replace(regexp, SECRET_REPLACEMENT) : output;
11
12
  };
@@ -36,7 +36,10 @@ module.exports = (context, pluginsPath) => {
36
36
  );
37
37
 
38
38
  plugins[type] = async input =>
39
- postprocess(await pipeline(steps, pipelineConfig && pipelineConfig(plugins, logger))(await preprocess(input)));
39
+ postprocess(
40
+ await pipeline(steps, pipelineConfig && pipelineConfig(plugins, logger))(await preprocess(input)),
41
+ input
42
+ );
40
43
 
41
44
  return plugins;
42
45
  },
package/lib/utils.js CHANGED
@@ -1,7 +1,20 @@
1
1
  const {isFunction} = require('lodash');
2
+ const hideSensitive = require('./hide-sensitive');
2
3
 
3
4
  function extractErrors(err) {
4
5
  return err && isFunction(err[Symbol.iterator]) ? [...err] : [err];
5
6
  }
6
7
 
7
- module.exports = {extractErrors};
8
+ function hideSensitiveValues(env, objs) {
9
+ const hideFunction = hideSensitive(env);
10
+ return objs.map(obj => {
11
+ Object.getOwnPropertyNames(obj).forEach(prop => {
12
+ if (obj[prop]) {
13
+ obj[prop] = hideFunction(obj[prop]);
14
+ }
15
+ });
16
+ return obj;
17
+ });
18
+ }
19
+
20
+ module.exports = {extractErrors, hideSensitiveValues};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "semantic-release",
3
3
  "description": "Automated semver compliant package publishing",
4
- "version": "15.9.8",
4
+ "version": "15.9.12",
5
5
  "author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
6
6
  "bin": {
7
7
  "semantic-release": "bin/semantic-release.js"
@@ -28,7 +28,7 @@
28
28
  "cosmiconfig": "^5.0.1",
29
29
  "debug": "^3.1.0",
30
30
  "env-ci": "^2.0.0",
31
- "execa": "^0.10.0",
31
+ "execa": "^1.0.0",
32
32
  "figures": "^2.0.0",
33
33
  "find-versions": "^2.0.0",
34
34
  "get-stream": "^4.0.0",
@@ -37,7 +37,7 @@
37
37
  "hook-std": "^1.1.0",
38
38
  "hosted-git-info": "^2.7.1",
39
39
  "lodash": "^4.17.4",
40
- "marked": "^0.4.0",
40
+ "marked": "^0.5.0",
41
41
  "marked-terminal": "^3.0.0",
42
42
  "p-locate": "^3.0.0",
43
43
  "p-reduce": "^1.0.0",
@@ -65,6 +65,7 @@
65
65
  "p-retry": "^2.0.0",
66
66
  "proxyquire": "^2.0.0",
67
67
  "sinon": "^6.0.0",
68
+ "stream-buffers": "^3.0.2",
68
69
  "tempy": "^0.2.1",
69
70
  "xo": "^0.22.0"
70
71
  },