|
1 |
| -import {inspect} from 'node:util'; |
| 1 | +import { inspect } from "node:util"; |
2 | 2 |
|
3 |
| -import {isString} from 'lodash-es'; |
| 3 | +import { isString } from "lodash-es"; |
4 | 4 |
|
5 |
| -const HOMEPAGE = 'https://github.com/semantic-release/github'; |
| 5 | +const HOMEPAGE = "https://github.com/semantic-release/github"; |
6 | 6 |
|
7 | 7 | const stringify = (object) =>
|
8 |
| - isString(object) ? object : inspect(object, {breakLength: Number.POSITIVE_INFINITY, depth: 2, maxArrayLength: 5}); |
| 8 | + isString(object) |
| 9 | + ? object |
| 10 | + : inspect(object, { |
| 11 | + breakLength: Number.POSITIVE_INFINITY, |
| 12 | + depth: 2, |
| 13 | + maxArrayLength: 5, |
| 14 | + }); |
9 | 15 | const linkify = (file) => `${HOMEPAGE}/blob/master/${file}`;
|
10 | 16 |
|
11 |
| -export function EINVALIDASSETS({assets}) { |
| 17 | +export function EINVALIDASSETS({ assets }) { |
12 | 18 | return {
|
13 |
| - message: 'Invalid `assets` option.', |
| 19 | + message: "Invalid `assets` option.", |
14 | 20 | details: `The [assets option](${linkify(
|
15 |
| - 'README.md#assets' |
| 21 | + "README.md#assets" |
16 | 22 | )}) must be an \`Array\` of \`Strings\` or \`Objects\` with a \`path\` property.
|
17 | 23 |
|
18 | 24 | Your configuration for the \`assets\` option is \`${stringify(assets)}\`.`,
|
19 | 25 | };
|
20 | 26 | }
|
21 | 27 |
|
22 |
| -export function EINVALIDSUCCESSCOMMENT({successComment}) { |
| 28 | +export function EINVALIDSUCCESSCOMMENT({ successComment }) { |
23 | 29 | return {
|
24 |
| - message: 'Invalid `successComment` option.', |
| 30 | + message: "Invalid `successComment` option.", |
25 | 31 | details: `The [successComment option](${linkify(
|
26 |
| - 'README.md#successcomment' |
| 32 | + "README.md#successcomment" |
27 | 33 | )}) if defined, must be a non empty \`String\`.
|
28 | 34 |
|
29 |
| -Your configuration for the \`successComment\` option is \`${stringify(successComment)}\`.`, |
| 35 | +Your configuration for the \`successComment\` option is \`${stringify( |
| 36 | + successComment |
| 37 | + )}\`.`, |
30 | 38 | };
|
31 | 39 | }
|
32 | 40 |
|
33 |
| -export function EINVALIDFAILTITLE({failTitle}) { |
| 41 | +export function EINVALIDFAILTITLE({ failTitle }) { |
34 | 42 | return {
|
35 |
| - message: 'Invalid `failTitle` option.', |
36 |
| - details: `The [failTitle option](${linkify('README.md#failtitle')}) if defined, must be a non empty \`String\`. |
| 43 | + message: "Invalid `failTitle` option.", |
| 44 | + details: `The [failTitle option](${linkify( |
| 45 | + "README.md#failtitle" |
| 46 | + )}) if defined, must be a non empty \`String\`. |
37 | 47 |
|
38 |
| -Your configuration for the \`failTitle\` option is \`${stringify(failTitle)}\`.`, |
| 48 | +Your configuration for the \`failTitle\` option is \`${stringify( |
| 49 | + failTitle |
| 50 | + )}\`.`, |
39 | 51 | };
|
40 | 52 | }
|
41 | 53 |
|
42 |
| -export function EINVALIDFAILCOMMENT({failComment}) { |
| 54 | +export function EINVALIDFAILCOMMENT({ failComment }) { |
43 | 55 | return {
|
44 |
| - message: 'Invalid `failComment` option.', |
45 |
| - details: `The [failComment option](${linkify('README.md#failcomment')}) if defined, must be a non empty \`String\`. |
| 56 | + message: "Invalid `failComment` option.", |
| 57 | + details: `The [failComment option](${linkify( |
| 58 | + "README.md#failcomment" |
| 59 | + )}) if defined, must be a non empty \`String\`. |
46 | 60 |
|
47 |
| -Your configuration for the \`failComment\` option is \`${stringify(failComment)}\`.`, |
| 61 | +Your configuration for the \`failComment\` option is \`${stringify( |
| 62 | + failComment |
| 63 | + )}\`.`, |
48 | 64 | };
|
49 | 65 | }
|
50 | 66 |
|
51 |
| -export function EINVALIDLABELS({labels}) { |
| 67 | +export function EINVALIDLABELS({ labels }) { |
52 | 68 | return {
|
53 |
| - message: 'Invalid `labels` option.', |
| 69 | + message: "Invalid `labels` option.", |
54 | 70 | details: `The [labels option](${linkify(
|
55 |
| - 'README.md#options' |
| 71 | + "README.md#options" |
56 | 72 | )}) if defined, must be an \`Array\` of non empty \`String\`.
|
57 | 73 |
|
58 | 74 | Your configuration for the \`labels\` option is \`${stringify(labels)}\`.`,
|
59 | 75 | };
|
60 | 76 | }
|
61 | 77 |
|
62 |
| -export function EINVALIDASSIGNEES({assignees}) { |
| 78 | +export function EINVALIDASSIGNEES({ assignees }) { |
63 | 79 | return {
|
64 |
| - message: 'Invalid `assignees` option.', |
65 |
| - details: `The [assignees option](${linkify('README.md#options')}) must be an \`Array\` of non empty \`Strings\`. |
66 |
| -
|
67 |
| -Your configuration for the \`assignees\` option is \`${stringify(assignees)}\`.`, |
| 80 | + message: "Invalid `assignees` option.", |
| 81 | + details: `The [assignees option](${linkify( |
| 82 | + "README.md#options" |
| 83 | + )}) must be an \`Array\` of non empty \`Strings\`. |
| 84 | +
|
| 85 | +Your configuration for the \`assignees\` option is \`${stringify( |
| 86 | + assignees |
| 87 | + )}\`.`, |
68 | 88 | };
|
69 | 89 | }
|
70 | 90 |
|
71 |
| -export function EINVALIDRELEASEDLABELS({releasedLabels}) { |
| 91 | +export function EINVALIDRELEASEDLABELS({ releasedLabels }) { |
72 | 92 | return {
|
73 |
| - message: 'Invalid `releasedLabels` option.', |
| 93 | + message: "Invalid `releasedLabels` option.", |
74 | 94 | details: `The [releasedLabels option](${linkify(
|
75 |
| - 'README.md#options' |
| 95 | + "README.md#options" |
76 | 96 | )}) if defined, must be an \`Array\` of non empty \`String\`.
|
77 | 97 |
|
78 |
| -Your configuration for the \`releasedLabels\` option is \`${stringify(releasedLabels)}\`.`, |
| 98 | +Your configuration for the \`releasedLabels\` option is \`${stringify( |
| 99 | + releasedLabels |
| 100 | + )}\`.`, |
79 | 101 | };
|
80 | 102 | }
|
81 | 103 |
|
82 |
| -export function EINVALIDADDRELEASES({addReleases}) { |
| 104 | +export function EINVALIDADDRELEASES({ addReleases }) { |
83 | 105 | return {
|
84 |
| - message: 'Invalid `addReleases` option.', |
85 |
| - details: `The [addReleases option](${linkify('README.md#options')}) if defined, must be one of \`false|top|bottom\`. |
86 |
| -
|
87 |
| -Your configuration for the \`addReleases\` option is \`${stringify(addReleases)}\`.`, |
| 106 | + message: "Invalid `addReleases` option.", |
| 107 | + details: `The [addReleases option](${linkify( |
| 108 | + "README.md#options" |
| 109 | + )}) if defined, must be one of \`false|top|bottom\`. |
| 110 | +
|
| 111 | +Your configuration for the \`addReleases\` option is \`${stringify( |
| 112 | + addReleases |
| 113 | + )}\`.`, |
88 | 114 | };
|
89 | 115 | }
|
90 | 116 |
|
91 | 117 | export function EINVALIDGITHUBURL() {
|
92 | 118 | return {
|
93 |
| - message: 'The git repository URL is not a valid GitHub URL.', |
| 119 | + message: "The git repository URL is not a valid GitHub URL.", |
94 | 120 | details: `The **semantic-release** \`repositoryUrl\` option must a valid GitHub URL with the format \`<GitHub_or_GHE_URL>/<owner>/<repo>.git\`.
|
95 | 121 |
|
96 | 122 | By default the \`repositoryUrl\` option is retrieved from the \`repository\` property of your \`package.json\` or the [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) of the repository cloned by your CI environment.`,
|
97 | 123 | };
|
98 | 124 | }
|
99 | 125 |
|
100 |
| -export function EINVALIDPROXY({proxy}) { |
| 126 | +export function EINVALIDPROXY({ proxy }) { |
101 | 127 | return {
|
102 |
| - message: 'Invalid `proxy` option.', |
| 128 | + message: "Invalid `proxy` option.", |
103 | 129 | details: `The [proxy option](${linkify(
|
104 |
| - 'README.md#proxy' |
| 130 | + "README.md#proxy" |
105 | 131 | )}) must be a \`String\` or an \`Objects\` with a \`host\` and a \`port\` property.
|
106 | 132 |
|
107 | 133 | Your configuration for the \`proxy\` option is \`${stringify(proxy)}\`.`,
|
108 | 134 | };
|
109 | 135 | }
|
110 | 136 |
|
111 |
| -export function EMISSINGREPO({owner, repo}) { |
| 137 | +export function EMISSINGREPO({ owner, repo }) { |
112 | 138 | return {
|
113 | 139 | message: `The repository ${owner}/${repo} doesn't exist.`,
|
114 | 140 | details: `The **semantic-release** \`repositoryUrl\` option must refer to your GitHub repository. The repository must be accessible with the [GitHub API](https://developer.github.com/v3).
|
115 | 141 |
|
116 | 142 | By default the \`repositoryUrl\` option is retrieved from the \`repository\` property of your \`package.json\` or the [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) of the repository cloned by your CI environment.
|
117 | 143 |
|
118 | 144 | If you are using [GitHub Enterprise](https://enterprise.github.com) please make sure to configure the \`githubUrl\` and \`githubApiPathPrefix\` [options](${linkify(
|
119 |
| - 'README.md#options' |
| 145 | + "README.md#options" |
120 | 146 | )}).`,
|
121 | 147 | };
|
122 | 148 | }
|
123 | 149 |
|
124 |
| -export function EGHNOPERMISSION({owner, repo}) { |
| 150 | +export function EGHNOPERMISSION({ owner, repo }) { |
125 | 151 | return {
|
126 | 152 | message: `The GitHub token doesn't allow to push on the repository ${owner}/${repo}.`,
|
127 | 153 | details: `The user associated with the [GitHub token](${linkify(
|
128 |
| - 'README.md#github-authentication' |
| 154 | + "README.md#github-authentication" |
129 | 155 | )}) configured in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable must allows to push to the repository ${owner}/${repo}.
|
130 | 156 |
|
131 | 157 | Please make sure the GitHub user associated with the token is an [owner](https://help.github.com/articles/permission-levels-for-a-user-account-repository/#owner-access-on-a-repository-owned-by-a-user-account) or a [collaborator](https://help.github.com/articles/permission-levels-for-a-user-account-repository/#collaborator-access-on-a-repository-owned-by-a-user-account) if the reposotory belong to a user account or has [write permissions](https://help.github.com/articles/managing-team-access-to-an-organization-repository) if the repository [belongs to an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization).`,
|
132 | 158 | };
|
133 | 159 | }
|
134 | 160 |
|
135 |
| -export function EINVALIDGHTOKEN({owner, repo}) { |
| 161 | +export function EINVALIDGHTOKEN({ owner, repo }) { |
136 | 162 | return {
|
137 |
| - message: 'Invalid GitHub token.', |
| 163 | + message: "Invalid GitHub token.", |
138 | 164 | details: `The [GitHub token](${linkify(
|
139 |
| - 'README.md#github-authentication' |
| 165 | + "README.md#github-authentication" |
140 | 166 | )}) configured in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable must be a valid [personal token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) allowing to push to the repository ${owner}/${repo}.
|
141 | 167 |
|
142 | 168 | Please make sure to set the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable in your CI with the exact value of the GitHub personal token.`,
|
143 | 169 | };
|
144 | 170 | }
|
145 | 171 |
|
146 |
| -export function ENOGHTOKEN({owner, repo}) { |
| 172 | +export function ENOGHTOKEN({ owner, repo }) { |
147 | 173 | return {
|
148 |
| - message: 'No GitHub token specified.', |
| 174 | + message: "No GitHub token specified.", |
149 | 175 | details: `A [GitHub personal token](${linkify(
|
150 |
| - 'README.md#github-authentication' |
| 176 | + "README.md#github-authentication" |
151 | 177 | )}) must be created and set in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable on your CI environment.
|
152 | 178 |
|
153 | 179 | Please make sure to create a [GitHub personal token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) and to set it in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable on your CI environment. The token must allow to push to the repository ${owner}/${repo}.`,
|
|
0 commit comments