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