-
Notifications
You must be signed in to change notification settings - Fork 129
/
resolve-config.js
66 lines (65 loc) · 1.89 KB
/
resolve-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { isNil, castArray } from "lodash-es";
export default function resolveConfig(
{
githubUrl,
githubApiUrl,
githubApiPathPrefix,
proxy,
assets,
successComment,
successCommentCondition,
failTitle,
failComment,
failCommentCondition,
labels,
assignees,
releasedLabels,
addReleases,
draftRelease,
releaseNameTemplate,
releaseBodyTemplate,
discussionCategoryName,
},
{ env },
) {
return {
githubToken: env.GH_TOKEN || env.GITHUB_TOKEN,
githubUrl: githubUrl || env.GH_URL || env.GITHUB_URL,
githubApiPathPrefix:
githubApiPathPrefix || env.GH_PREFIX || env.GITHUB_PREFIX || "",
githubApiUrl: githubApiUrl || env.GITHUB_API_URL,
proxy: isNil(proxy) ? env.http_proxy || env.HTTP_PROXY || false : proxy,
assets: assets ? castArray(assets) : assets,
successComment,
successCommentCondition,
failTitle: isNil(failTitle)
? "The automated release is failing 🚨"
: failTitle,
failComment,
failCommentCondition,
labels: isNil(labels)
? ["semantic-release"]
: labels === false
? false
: castArray(labels),
assignees: assignees ? castArray(assignees) : assignees,
releasedLabels: isNil(releasedLabels)
? [
`released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>`,
]
: releasedLabels === false
? false
: castArray(releasedLabels),
addReleases: isNil(addReleases) ? false : addReleases,
draftRelease: isNil(draftRelease) ? false : draftRelease,
releaseBodyTemplate: !isNil(releaseBodyTemplate)
? releaseBodyTemplate
: "<%= nextRelease.notes %>",
releaseNameTemplate: !isNil(releaseNameTemplate)
? releaseNameTemplate
: "<%= nextRelease.name %>",
discussionCategoryName: isNil(discussionCategoryName)
? false
: discussionCategoryName,
};
}