@semantic-release/github 7.1.2 → 7.2.3
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 +3 -5
- package/lib/get-fail-comment.js +3 -3
- package/lib/glob-assets.js +1 -2
- package/lib/parse-github-url.js +1 -1
- package/lib/publish.js +15 -7
- package/lib/resolve-config.js +1 -1
- package/lib/verify.js +3 -2
- package/package.json +12 -10
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
|
-
[](https://codecov.io/gh/semantic-release/github)
|
|
8
|
-
[](https://greenkeeper.io/)
|
|
6
|
+
[](https://github.com/semantic-release/github/actions?query=workflow%3ATest+branch%3Amaster)
|
|
9
7
|
|
|
10
8
|
[](https://www.npmjs.com/package/@semantic-release/github)
|
|
11
9
|
[](https://www.npmjs.com/package/@semantic-release/github)
|
|
@@ -76,7 +74,7 @@ If you have actions that trigger on newly created releases, please use a generat
|
|
|
76
74
|
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
77
75
|
| `githubUrl` | The GitHub Enterprise endpoint. | `GH_URL` or `GITHUB_URL` environment variable. |
|
|
78
76
|
| `githubApiPathPrefix` | The GitHub Enterprise API prefix. | `GH_PREFIX` or `GITHUB_PREFIX` environment variable. |
|
|
79
|
-
| `proxy` | The proxy to use to access the GitHub API. See [proxy](#proxy). | `HTTP_PROXY` environment variable. |
|
|
77
|
+
| `proxy` | The proxy to use to access the GitHub API. Set to `false` to disable usage of proxy. See [proxy](#proxy). | `HTTP_PROXY` environment variable. |
|
|
80
78
|
| `assets` | An array of files to upload to the release. See [assets](#assets). | - |
|
|
81
79
|
| `successComment` | The comment to add to each issue and pull request resolved by the release. Set to `false` to disable commenting on issues and pull requests. See [successComment](#successcomment). | `:tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitHub release](<github_release_url>)` |
|
|
82
80
|
| `failComment` | The content of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. See [failComment](#failcomment). | Friendly message with links to **semantic-release** documentation and support, with the list of errors that caused the release to fail. |
|
|
@@ -88,7 +86,7 @@ If you have actions that trigger on newly created releases, please use a generat
|
|
|
88
86
|
|
|
89
87
|
#### proxy
|
|
90
88
|
|
|
91
|
-
Can be a
|
|
89
|
+
Can be `false`, a proxy URL or an `Object` with the following properties:
|
|
92
90
|
|
|
93
91
|
| Property | Description | Default |
|
|
94
92
|
|---------------|----------------------------------------------------------------|--------------------------------------|
|
package/lib/get-fail-comment.js
CHANGED
|
@@ -19,9 +19,9 @@ module.exports = (branch, errors) => `## :rotating_light: The automated release
|
|
|
19
19
|
branch.name
|
|
20
20
|
}\` branch failed. :rotating_light:
|
|
21
21
|
|
|
22
|
-
I recommend you give this issue a high priority, so other packages depending on you
|
|
22
|
+
I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
|
|
23
23
|
|
|
24
|
-
You can find below the list of errors reported by **semantic-release**. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can
|
|
24
|
+
You can find below the list of errors reported by **semantic-release**. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.
|
|
25
25
|
|
|
26
26
|
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ Once all the errors are resolved, **semantic-release** will release your package
|
|
|
29
29
|
branch.name
|
|
30
30
|
}\` branch. You can also manually restart the failed CI job that runs **semantic-release**.
|
|
31
31
|
|
|
32
|
-
If you are not sure how to resolve this, here
|
|
32
|
+
If you are not sure how to resolve this, here are some links that can help you:
|
|
33
33
|
- [Usage documentation](${USAGE_DOC_URL})
|
|
34
34
|
- [Frequently Asked Questions](${FAQ_URL})
|
|
35
35
|
- [Support channels](${GET_HELP_URL})
|
package/lib/glob-assets.js
CHANGED
|
@@ -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:
|
package/lib/parse-github-url.js
CHANGED
package/lib/publish.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
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 = {
|
|
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/lib/resolve-config.js
CHANGED
|
@@ -19,7 +19,7 @@ module.exports = (
|
|
|
19
19
|
githubToken: env.GH_TOKEN || env.GITHUB_TOKEN,
|
|
20
20
|
githubUrl: githubUrl || env.GITHUB_API_URL || env.GH_URL || env.GITHUB_URL,
|
|
21
21
|
githubApiPathPrefix: githubApiPathPrefix || env.GH_PREFIX || env.GITHUB_PREFIX || '',
|
|
22
|
-
proxy: proxy || env.HTTP_PROXY,
|
|
22
|
+
proxy: isNil(proxy) ? env.http_proxy || env.HTTP_PROXY || false : proxy,
|
|
23
23
|
assets: assets ? castArray(assets) : assets,
|
|
24
24
|
successComment,
|
|
25
25
|
failTitle: isNil(failTitle) ? 'The automated release is failing 🚨' : failTitle,
|
package/lib/verify.js
CHANGED
|
@@ -14,8 +14,9 @@ const isArrayOf = (validator) => (array) => isArray(array) && array.every((value
|
|
|
14
14
|
const canBeDisabled = (validator) => (value) => value === false || validator(value);
|
|
15
15
|
|
|
16
16
|
const VALIDATORS = {
|
|
17
|
-
proxy: (
|
|
18
|
-
isNonEmptyString(proxy) || (isPlainObject(proxy) && isNonEmptyString(proxy.host) && isNumber(proxy.port))
|
|
17
|
+
proxy: canBeDisabled(
|
|
18
|
+
(proxy) => isNonEmptyString(proxy) || (isPlainObject(proxy) && isNonEmptyString(proxy.host) && isNumber(proxy.port))
|
|
19
|
+
),
|
|
19
20
|
assets: isArrayOf(
|
|
20
21
|
(asset) => isStringOrStringArray(asset) || (isPlainObject(asset) && isStringOrStringArray(asset.path))
|
|
21
22
|
),
|
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.
|
|
4
|
+
"version": "7.2.3",
|
|
5
5
|
"author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)",
|
|
6
6
|
"ava": {
|
|
7
7
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"bottleneck": "^2.18.1",
|
|
23
23
|
"debug": "^4.0.0",
|
|
24
24
|
"dir-glob": "^3.0.0",
|
|
25
|
-
"fs-extra": "^
|
|
25
|
+
"fs-extra": "^10.0.0",
|
|
26
26
|
"globby": "^11.0.0",
|
|
27
27
|
"http-proxy-agent": "^4.0.0",
|
|
28
28
|
"https-proxy-agent": "^5.0.0",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"url-join": "^4.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"ava": "3.
|
|
37
|
+
"ava": "3.15.0",
|
|
38
38
|
"clear-module": "4.1.1",
|
|
39
39
|
"codecov": "3.8.1",
|
|
40
|
-
"nock": "
|
|
40
|
+
"nock": "13.0.9",
|
|
41
41
|
"nyc": "15.1.0",
|
|
42
42
|
"proxy": "1.0.2",
|
|
43
43
|
"proxyquire": "2.1.3",
|
|
44
|
-
"semantic-release": "17.
|
|
44
|
+
"semantic-release": "17.3.9",
|
|
45
45
|
"server-destroy": "1.0.1",
|
|
46
|
-
"sinon": "9.2.
|
|
47
|
-
"tempy": "0.
|
|
48
|
-
"xo": "0.
|
|
46
|
+
"sinon": "9.2.4",
|
|
47
|
+
"tempy": "1.0.0",
|
|
48
|
+
"xo": "0.36.1"
|
|
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": {
|