@semantic-release/github 7.1.2 → 7.2.0

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.
package/README.md CHANGED
@@ -3,9 +3,7 @@
3
3
  [**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to publish a
4
4
  [GitHub release](https://help.github.com/articles/about-releases) and comment on released Pull Requests/Issues.
5
5
 
6
- [![Travis](https://img.shields.io/travis/semantic-release/github.svg)](https://travis-ci.org/semantic-release/github)
7
- [![Codecov](https://img.shields.io/codecov/c/github/semantic-release/github.svg)](https://codecov.io/gh/semantic-release/github)
8
- [![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/github.svg)](https://greenkeeper.io/)
6
+ [![Build Status](https://github.com/semantic-release/github/workflows/Test/badge.svg)](https://github.com/semantic-release/github/actions?query=workflow%3ATest+branch%3Amaster)
9
7
 
10
8
  [![npm latest version](https://img.shields.io/npm/v/@semantic-release/github/latest.svg)](https://www.npmjs.com/package/@semantic-release/github)
11
9
  [![npm next version](https://img.shields.io/npm/v/@semantic-release/github/next.svg)](https://www.npmjs.com/package/@semantic-release/github)
@@ -1,5 +1,4 @@
1
1
  const path = require('path');
2
- const {basename} = require('path');
3
2
  const {isPlainObject, castArray, uniqWith, uniq} = require('lodash');
4
3
  const dirGlob = require('dir-glob');
5
4
  const globby = require('globby');
@@ -40,7 +39,7 @@ module.exports = async ({cwd}, assets) =>
40
39
  // - `path` of the matched file
41
40
  // - `name` based on the actual file name (to avoid assets with duplicate `name`)
42
41
  // - other properties of the original asset definition
43
- return globbed.map((file) => ({...asset, path: file, name: basename(file)}));
42
+ return globbed.map((file) => ({...asset, path: file, name: path.basename(file)}));
44
43
  }
45
44
 
46
45
  // If asset is an Object, output an Object definition with:
@@ -5,7 +5,7 @@ module.exports = (repositoryUrl) => {
5
5
  new URL(match ? `ssh://${auth ? `${auth}@` : ''}${host}/${path}` : repositoryUrl).pathname
6
6
  );
7
7
  return {owner, repo};
8
- } catch (_) {
8
+ } catch {
9
9
  return {};
10
10
  }
11
11
  };
package/lib/publish.js CHANGED
@@ -1,4 +1,4 @@
1
- const {basename, extname, resolve} = require('path');
1
+ const path = require('path');
2
2
  const {stat, readFile} = require('fs-extra');
3
3
  const {isPlainObject, template} = require('lodash');
4
4
  const mime = require('mime');
@@ -21,7 +21,15 @@ module.exports = async (pluginConfig, context) => {
21
21
  const {githubToken, githubUrl, githubApiPathPrefix, proxy, assets} = resolveConfig(pluginConfig, context);
22
22
  const {owner, repo} = parseGithubUrl(repositoryUrl);
23
23
  const github = getClient({githubToken, githubUrl, githubApiPathPrefix, proxy});
24
- const release = {owner, repo, tag_name: gitTag, name, body: notes, prerelease: isPrerelease(branch)};
24
+ const release = {
25
+ owner,
26
+ repo,
27
+ tag_name: gitTag,
28
+ target_commitish: branch.name,
29
+ name,
30
+ body: notes,
31
+ prerelease: isPrerelease(branch),
32
+ };
25
33
 
26
34
  debug('release object: %O', release);
27
35
 
@@ -53,8 +61,8 @@ module.exports = async (pluginConfig, context) => {
53
61
  let file;
54
62
 
55
63
  try {
56
- file = await stat(resolve(cwd, filePath));
57
- } catch (_) {
64
+ file = await stat(path.resolve(cwd, filePath));
65
+ } catch {
58
66
  logger.error('The asset %s cannot be read, and will be ignored.', filePath);
59
67
  return;
60
68
  }
@@ -64,13 +72,13 @@ module.exports = async (pluginConfig, context) => {
64
72
  return;
65
73
  }
66
74
 
67
- const fileName = template(asset.name || basename(filePath))(context);
75
+ const fileName = template(asset.name || path.basename(filePath))(context);
68
76
  const upload = {
69
77
  url: uploadUrl,
70
- data: await readFile(resolve(cwd, filePath)),
78
+ data: await readFile(path.resolve(cwd, filePath)),
71
79
  name: fileName,
72
80
  headers: {
73
- 'content-type': mime.getType(extname(fileName)) || 'text/plain',
81
+ 'content-type': mime.getType(path.extname(fileName)) || 'text/plain',
74
82
  'content-length': file.size,
75
83
  },
76
84
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semantic-release/github",
3
3
  "description": "semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues",
4
- "version": "7.1.2",
4
+ "version": "7.2.0",
5
5
  "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)",
6
6
  "ava": {
7
7
  "files": [
@@ -37,15 +37,15 @@
37
37
  "ava": "3.13.0",
38
38
  "clear-module": "4.1.1",
39
39
  "codecov": "3.8.1",
40
- "nock": "12.0.3",
40
+ "nock": "13.0.5",
41
41
  "nyc": "15.1.0",
42
42
  "proxy": "1.0.2",
43
43
  "proxyquire": "2.1.3",
44
- "semantic-release": "17.2.2",
44
+ "semantic-release": "17.2.3",
45
45
  "server-destroy": "1.0.1",
46
46
  "sinon": "9.2.1",
47
- "tempy": "0.5.0",
48
- "xo": "0.30.0"
47
+ "tempy": "1.0.0",
48
+ "xo": "0.34.2"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=10.18"
@@ -99,7 +99,8 @@
99
99
  "lint": "xo",
100
100
  "pretest": "npm run lint",
101
101
  "semantic-release": "semantic-release",
102
- "test": "nyc ava -v"
102
+ "test": "nyc ava -v",
103
+ "test:ci": "nyc ava -v"
103
104
  },
104
105
  "xo": {
105
106
  "prettier": true,
@@ -111,7 +112,8 @@
111
112
  "properties": "never"
112
113
  }
113
114
  ],
114
- "unicorn/string-content": "off"
115
+ "unicorn/string-content": "off",
116
+ "unicorn/no-reduce": "off"
115
117
  }
116
118
  },
117
119
  "renovate": {