|
1 | 1 | import {template} from 'lodash';
|
2 | 2 | import debugFactory from 'debug';
|
3 |
| -import parseGithubUrl from './parse-github-url'; |
4 |
| -import {ISSUE_ID} from './definitions/constants'; |
5 |
| -import resolveConfig from './resolve-config'; |
6 |
| -import getClient from './get-client'; |
7 |
| -import findSRIssues from './find-sr-issues'; |
8 |
| -import getFailComment from './get-fail-comment'; |
| 3 | +import parseGithubUrl from './parse-github-url.js'; |
| 4 | +import {ISSUE_ID} from './definitions/constants.js'; |
| 5 | +import resolveConfig from './resolve-config.js'; |
| 6 | +import getClient from './get-client.js'; |
| 7 | +import findSRIssues from './find-sr-issues.js'; |
| 8 | +import getFailComment from './get-fail-comment.js'; |
9 | 9 |
|
10 | 10 | const debug = debugFactory('semantic-release:github');
|
11 | 11 |
|
12 |
| -export default async (pluginConfig, context) => { |
| 12 | +export default async function fail(pluginConfig, context) { |
13 | 13 | const {
|
14 | 14 | options: {repositoryUrl},
|
15 | 15 | branch,
|
@@ -39,12 +39,19 @@ export default async (pluginConfig, context) => {
|
39 | 39 | } = await github.issues.createComment(comment);
|
40 | 40 | logger.log('Added comment to issue #%d: %s.', srIssue.number, url);
|
41 | 41 | } else {
|
42 |
| - const newIssue = {owner, repo, title: failTitle, body: `${body}\n\n${ISSUE_ID}`, labels: labels || [], assignees}; |
| 42 | + const newIssue = { |
| 43 | + owner, |
| 44 | + repo, |
| 45 | + title: failTitle, |
| 46 | + body: `${body}\n\n${ISSUE_ID}`, |
| 47 | + labels: labels || [], |
| 48 | + assignees, |
| 49 | + }; |
43 | 50 | debug('create issue: %O', newIssue);
|
44 | 51 | const {
|
45 | 52 | data: {html_url: url, number},
|
46 | 53 | } = await github.issues.create(newIssue);
|
47 | 54 | logger.log('Created issue #%d: %s.', number, url);
|
48 | 55 | }
|
49 | 56 | }
|
50 |
| -}; |
| 57 | +} |
0 commit comments