@release-change/github 0.1.0
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/close-issue.d.ts +8 -0
- package/dist/close-issue.d.ts.map +1 -0
- package/dist/close-issue.js +63 -0
- package/dist/close-issue.js.map +1 -0
- package/dist/create-pull-request.d.ts +8 -0
- package/dist/create-pull-request.d.ts.map +1 -0
- package/dist/create-pull-request.js +96 -0
- package/dist/create-pull-request.js.map +1 -0
- package/dist/find-npm-tag-from-git-tag.d.ts +9 -0
- package/dist/find-npm-tag-from-git-tag.d.ts.map +1 -0
- package/dist/find-npm-tag-from-git-tag.js +11 -0
- package/dist/find-npm-tag-from-git-tag.js.map +1 -0
- package/dist/get-associated-pull-requests.d.ts +11 -0
- package/dist/get-associated-pull-requests.d.ts.map +1 -0
- package/dist/get-associated-pull-requests.js +81 -0
- package/dist/get-associated-pull-requests.js.map +1 -0
- package/dist/get-issues.d.ts +10 -0
- package/dist/get-issues.d.ts.map +1 -0
- package/dist/get-issues.js +33 -0
- package/dist/get-issues.js.map +1 -0
- package/dist/get-related-pull-requests-and-issues.d.ts +10 -0
- package/dist/get-related-pull-requests-and-issues.d.ts.map +1 -0
- package/dist/get-related-pull-requests-and-issues.js +77 -0
- package/dist/get-related-pull-requests-and-issues.js.map +1 -0
- package/dist/get-repository-related-entry-point.d.ts +7 -0
- package/dist/get-repository-related-entry-point.d.ts.map +1 -0
- package/dist/get-repository-related-entry-point.js +23 -0
- package/dist/get-repository-related-entry-point.js.map +1 -0
- package/dist/github.types.d.ts +16 -0
- package/dist/github.types.d.ts.map +1 -0
- package/dist/github.types.js +2 -0
- package/dist/github.types.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/is-auto-merge-allowed.d.ts +3 -0
- package/dist/is-auto-merge-allowed.d.ts.map +1 -0
- package/dist/is-auto-merge-allowed.js +52 -0
- package/dist/is-auto-merge-allowed.js.map +1 -0
- package/dist/linkify-release-info.d.ts +8 -0
- package/dist/linkify-release-info.d.ts.map +1 -0
- package/dist/linkify-release-info.js +10 -0
- package/dist/linkify-release-info.js.map +1 -0
- package/dist/merge-references-by-number.d.ts +10 -0
- package/dist/merge-references-by-number.d.ts.map +1 -0
- package/dist/merge-references-by-number.js +32 -0
- package/dist/merge-references-by-number.js.map +1 -0
- package/dist/post-fail-comment.d.ts +8 -0
- package/dist/post-fail-comment.d.ts.map +1 -0
- package/dist/post-fail-comment.js +100 -0
- package/dist/post-fail-comment.js.map +1 -0
- package/dist/post-success-comment.d.ts +8 -0
- package/dist/post-success-comment.d.ts.map +1 -0
- package/dist/post-success-comment.js +115 -0
- package/dist/post-success-comment.js.map +1 -0
- package/dist/tag-pull-request-and-issue.d.ts +3 -0
- package/dist/tag-pull-request-and-issue.d.ts.map +1 -0
- package/dist/tag-pull-request-and-issue.js +87 -0
- package/dist/tag-pull-request-and-issue.js.map +1 -0
- package/package.json +40 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { closeIssue } from "./close-issue.js";
|
|
2
|
+
export { createPullRequest } from "./create-pull-request.js";
|
|
3
|
+
export { getRelatedPullRequestsAndIssues } from "./get-related-pull-requests-and-issues.js";
|
|
4
|
+
export { getRepositoryRelatedEntryPoint } from "./get-repository-related-entry-point.js";
|
|
5
|
+
export { postFailComment } from "./post-fail-comment.js";
|
|
6
|
+
export { postSuccessComment } from "./post-success-comment.js";
|
|
7
|
+
export { tagPullRequestAndIssue } from "./tag-pull-request-and-issue.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-auto-merge-allowed.d.ts","sourceRoot":"","sources":["../src/is-auto-merge-allowed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAStD,eAAO,MAAM,kBAAkB,GAC7B,sBAAsB,MAAM,EAC5B,SAAS,OAAO,KACf,OAAO,CAAC,OAAO,CAkDjB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { inspect } from "node:util";
|
|
2
|
+
import { getIssueAndPullRequestToken } from "@release-change/ci";
|
|
3
|
+
import { setLogger } from "@release-change/logger";
|
|
4
|
+
import { formatDetailedError } from "@release-change/shared";
|
|
5
|
+
export const isAutoMergeAllowed = async (repositoryEntryPoint, context) => {
|
|
6
|
+
if (repositoryEntryPoint) {
|
|
7
|
+
const { env, config: { debug } } = context;
|
|
8
|
+
const logger = setLogger(debug);
|
|
9
|
+
const issuePullRequestToken = getIssueAndPullRequestToken(env);
|
|
10
|
+
const repositoryResponse = await fetch(repositoryEntryPoint, {
|
|
11
|
+
headers: {
|
|
12
|
+
Accept: "application/vnd.github+json",
|
|
13
|
+
Authorization: `Bearer ${issuePullRequestToken}`,
|
|
14
|
+
"Content-Type": "application/json",
|
|
15
|
+
"X-GitHub-Api-Version": "2022-11-28"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const { headers, status, statusText } = repositoryResponse;
|
|
19
|
+
const repositoryResponseData = await repositoryResponse.json();
|
|
20
|
+
if (debug) {
|
|
21
|
+
logger.setDebugScope("github:create-pull-request");
|
|
22
|
+
logger.logDebug(`API entry point: ${repositoryEntryPoint}`);
|
|
23
|
+
logger.logDebug(`Response status: ${status}`);
|
|
24
|
+
logger.logDebug(`Response status text: ${statusText}`);
|
|
25
|
+
logger.logDebug(`Response headers: ${inspect(headers, { depth: Number.POSITIVE_INFINITY })}`);
|
|
26
|
+
logger.logDebug(`Response JSON: ${inspect(repositoryResponseData, { depth: Number.POSITIVE_INFINITY })}`);
|
|
27
|
+
}
|
|
28
|
+
if (status === 200)
|
|
29
|
+
return Boolean(repositoryResponseData.allow_auto_merge);
|
|
30
|
+
const responseError = repositoryResponseData;
|
|
31
|
+
const { message, documentation_url: documentationUrl } = responseError;
|
|
32
|
+
const documentationReference = documentationUrl ? ` See ${documentationUrl}.` : "";
|
|
33
|
+
process.exitCode = status;
|
|
34
|
+
throw formatDetailedError({
|
|
35
|
+
title: "Failed to check if auto-merge is allowed",
|
|
36
|
+
message: `${message}${documentationReference}`,
|
|
37
|
+
details: {
|
|
38
|
+
output: `status: ${status}`,
|
|
39
|
+
command: `POST ${repositoryEntryPoint}`
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
throw formatDetailedError({
|
|
45
|
+
title: "Failed to check if auto-merge is allowed",
|
|
46
|
+
message: "The entry point must not be empty.",
|
|
47
|
+
details: {
|
|
48
|
+
output: "repositoryEntryPoint: "
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=is-auto-merge-allowed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-auto-merge-allowed.js","sourceRoot":"","sources":["../src/is-auto-merge-allowed.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,2BAA2B,EAAE,MA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,CACb,kBAAkB,OAAO,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,CACzF,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;QAC5E,MAAM,aAAa,GAAwB,sBAAsB,CAAC;QAClE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,aAAa,CAAC;QACvE,MAAM,sBAAsB,GAAG,gBAAgB,CAAC,CAAC,CAAC,QAAQ,gBAAgB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC1B,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,0CAA0C;YACjD,OAAO,EAAE,GAAG,OAAO,GAAG,sBAAsB,EAAE;YAC9C,OAAO,EAAE;gBACP,MAAM,EAAE,WAAW,MAAM,EAAE;gBAC3B,OAAO,EAAE,QAAQ,oBAAoB,EAAE;aACxC;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACrB,MAAM,mBAAmB,CAAC;QACxB,KAAK,EAAE,0CAA0C;QACjD,OAAO,EAAE,oCAAoC;QAC7C,OAAO,EAAE;YACP,MAAM,EAAE,wBAAwB;SACjC;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReleaseInfo } from "@release-change/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Generates a link in Markdown to a piece of release info.
|
|
4
|
+
* @param releaseInfo - The release info to analyse.
|
|
5
|
+
* @return The release info displayed within a link if the `url` property is set, the release info displayed as code otherwise.
|
|
6
|
+
*/
|
|
7
|
+
export declare const linkifyReleaseInfo: (releaseInfo: ReleaseInfo) => string;
|
|
8
|
+
//# sourceMappingURL=linkify-release-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkify-release-info.d.ts","sourceRoot":"","sources":["../src/linkify-release-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,aAAa,WAAW,KAAG,MAG7D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a link in Markdown to a piece of release info.
|
|
3
|
+
* @param releaseInfo - The release info to analyse.
|
|
4
|
+
* @return The release info displayed within a link if the `url` property is set, the release info displayed as code otherwise.
|
|
5
|
+
*/
|
|
6
|
+
export const linkifyReleaseInfo = (releaseInfo) => {
|
|
7
|
+
const { name, url } = releaseInfo;
|
|
8
|
+
return `[${name}](${url})`;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=linkify-release-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkify-release-info.js","sourceRoot":"","sources":["../src/linkify-release-info.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,WAAwB,EAAU,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC;IAClC,OAAO,IAAI,IAAI,KAAK,GAAG,GAAG,CAAC;AAC7B,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Reference } from "@release-change/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Merges references sharing the same number together.
|
|
4
|
+
*
|
|
5
|
+
* For each merged reference, the `gitTags` property is transformed into an array of unique Git tag values.
|
|
6
|
+
* @param references - The references to merge.
|
|
7
|
+
* @return An array of merged references.
|
|
8
|
+
*/
|
|
9
|
+
export declare const mergeReferencesByNumber: (references: Reference[]) => Reference[];
|
|
10
|
+
//# sourceMappingURL=merge-references-by-number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-references-by-number.d.ts","sourceRoot":"","sources":["../src/merge-references-by-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAAI,YAAY,SAAS,EAAE,KAAG,SAAS,EAsB1E,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges references sharing the same number together.
|
|
3
|
+
*
|
|
4
|
+
* For each merged reference, the `gitTags` property is transformed into an array of unique Git tag values.
|
|
5
|
+
* @param references - The references to merge.
|
|
6
|
+
* @return An array of merged references.
|
|
7
|
+
*/
|
|
8
|
+
export const mergeReferencesByNumber = (references) => {
|
|
9
|
+
const map = new Map();
|
|
10
|
+
for (const reference of references) {
|
|
11
|
+
const { number, isPullRequest, gitTags } = reference;
|
|
12
|
+
const existing = map.get(number);
|
|
13
|
+
if (existing) {
|
|
14
|
+
for (const gitTag of gitTags) {
|
|
15
|
+
existing.gitTagsSet.add(gitTag);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
map.set(number, {
|
|
20
|
+
number,
|
|
21
|
+
isPullRequest,
|
|
22
|
+
gitTagsSet: new Set(reference.gitTags)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return Array.from(map.values(), obj => ({
|
|
27
|
+
number: obj.number,
|
|
28
|
+
isPullRequest: obj.isPullRequest,
|
|
29
|
+
gitTags: Array.from(obj.gitTagsSet)
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=merge-references-by-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-references-by-number.js","sourceRoot":"","sources":["../src/merge-references-by-number.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,UAAuB,EAAe,EAAE;IAC9E,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IACtB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;QACrD,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE;gBACd,MAAM;gBACN,aAAa;gBACb,UAAU,EAAE,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC;aACvC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;KACpC,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Context, Reference } from "@release-change/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Posts a fail comment on the issue or the pull request to notify the release failure.
|
|
4
|
+
* @param reference - The reference of the issue or pull request.
|
|
5
|
+
* @param context - The context where the CLI is running.
|
|
6
|
+
*/
|
|
7
|
+
export declare const postFailComment: (reference: Reference, context: Context) => Promise<void>;
|
|
8
|
+
//# sourceMappingURL=post-fail-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-fail-comment.d.ts","sourceRoot":"","sources":["../src/post-fail-comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAWjE;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAU,WAAW,SAAS,EAAE,SAAS,OAAO,KAAG,OAAO,CAAC,IAAI,CAiG1F,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { inspect } from "node:util";
|
|
2
|
+
import { getIssueAndPullRequestToken } from "@release-change/ci";
|
|
3
|
+
import { setLogger } from "@release-change/logger";
|
|
4
|
+
import { formatDetailedError } from "@release-change/shared";
|
|
5
|
+
import { getRepositoryRelatedEntryPoint } from "./get-repository-related-entry-point.js";
|
|
6
|
+
/**
|
|
7
|
+
* Posts a fail comment on the issue or the pull request to notify the release failure.
|
|
8
|
+
* @param reference - The reference of the issue or pull request.
|
|
9
|
+
* @param context - The context where the CLI is running.
|
|
10
|
+
*/
|
|
11
|
+
export const postFailComment = async (reference, context) => {
|
|
12
|
+
const { env, config: { debug, repositoryUrl }, errors, branch } = context;
|
|
13
|
+
const logger = setLogger(debug);
|
|
14
|
+
if (branch) {
|
|
15
|
+
const issuePullRequestToken = getIssueAndPullRequestToken(env);
|
|
16
|
+
const repositoryEntryPoint = getRepositoryRelatedEntryPoint(repositoryUrl);
|
|
17
|
+
const { number, isPullRequest } = reference;
|
|
18
|
+
const uri = `${repositoryEntryPoint}/issues/${number}/comments`;
|
|
19
|
+
const errorsList = [];
|
|
20
|
+
for (const error of errors) {
|
|
21
|
+
const { title, message, details: { output, command } } = error;
|
|
22
|
+
let errorBody = `##### ${title}\n\n${message || "This error does not have any additional information."}`;
|
|
23
|
+
if (command)
|
|
24
|
+
errorBody += `\n\nConcerned command: \`${command}\``;
|
|
25
|
+
if (output)
|
|
26
|
+
errorBody += `\n\n\`\`\`\n${output}\n\`\`\``;
|
|
27
|
+
errorsList.push(errorBody);
|
|
28
|
+
}
|
|
29
|
+
const errorsBody = errorsList.length
|
|
30
|
+
? [...new Set(errorsList.map(error => JSON.stringify(error)))]
|
|
31
|
+
.map(error => JSON.parse(error))
|
|
32
|
+
.join("\n\n---\n\n")
|
|
33
|
+
: "No errors reported.";
|
|
34
|
+
const commentBody = `#### The release failed
|
|
35
|
+
|
|
36
|
+
The release from the \`${branch}\` branch failed.
|
|
37
|
+
|
|
38
|
+
Below are the errors thrown when running the CLI.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
${errorsBody}
|
|
43
|
+
|
|
44
|
+
---`;
|
|
45
|
+
const requestBody = {
|
|
46
|
+
body: commentBody
|
|
47
|
+
};
|
|
48
|
+
const failCommentResponse = await fetch(uri, {
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: {
|
|
51
|
+
Accept: "application/vnd.github+json",
|
|
52
|
+
Authorization: `Bearer ${issuePullRequestToken}`,
|
|
53
|
+
"Content-Type": "application/json",
|
|
54
|
+
"X-GitHub-Api-Version": "2022-11-28"
|
|
55
|
+
},
|
|
56
|
+
body: JSON.stringify(requestBody)
|
|
57
|
+
});
|
|
58
|
+
const { headers, status, statusText } = failCommentResponse;
|
|
59
|
+
const issueType = isPullRequest ? "pull request" : "issue";
|
|
60
|
+
const failCommentResponseData = failCommentResponse.json();
|
|
61
|
+
if (debug) {
|
|
62
|
+
logger.setDebugScope("github:post-fail-comment");
|
|
63
|
+
logger.logDebug(`API entry point: ${uri}`);
|
|
64
|
+
logger.logDebug(`Request body: ${inspect(requestBody, { depth: Number.POSITIVE_INFINITY })}`);
|
|
65
|
+
logger.logDebug(`Response status: ${status}`);
|
|
66
|
+
logger.logDebug(`Response status text: ${statusText}`);
|
|
67
|
+
logger.logDebug(`Response headers: ${inspect(headers, { depth: Number.POSITIVE_INFINITY })}`);
|
|
68
|
+
logger.logDebug(`Response JSON: ${inspect(await failCommentResponseData, { depth: Number.POSITIVE_INFINITY })}`);
|
|
69
|
+
}
|
|
70
|
+
if (status === 201)
|
|
71
|
+
logger.logInfo(`Added fail comment on ${issueType} #${number}.`);
|
|
72
|
+
else if (status === 404)
|
|
73
|
+
logger.logWarn(`The resource requested for ${issueType} #${number} has not been found; therefore, the fail comment has not been added.`);
|
|
74
|
+
else {
|
|
75
|
+
const responseError = await failCommentResponseData;
|
|
76
|
+
const { message, documentation_url: documentationUrl } = responseError;
|
|
77
|
+
const documentationReference = documentationUrl ? ` See ${documentationUrl}.` : "";
|
|
78
|
+
logger.logError(`Failed to post the fail comment on ${issueType} #${number}.`);
|
|
79
|
+
process.exitCode = status;
|
|
80
|
+
throw formatDetailedError({
|
|
81
|
+
title: "Failed to post the fail comment",
|
|
82
|
+
message: `${message}${documentationReference}`,
|
|
83
|
+
details: {
|
|
84
|
+
output: `status: ${status}`
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
process.exitCode = 1;
|
|
91
|
+
throw formatDetailedError({
|
|
92
|
+
title: "Failed to post the fail comment",
|
|
93
|
+
message: "The target branch is not defined.",
|
|
94
|
+
details: {
|
|
95
|
+
output: "branch: undefined"
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=post-fail-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-fail-comment.js","sourceRoot":"","sources":["../src/post-fail-comment.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAEzF;;;;GAIG;AACH,MAAM,CAA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type { Context, Reference } from "@release-change/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Posts a success comment on the issue or the pull request to notify the release success.
|
|
4
|
+
* @param reference - The reference of the issue or pull request.
|
|
5
|
+
* @param context - The context where the CLI is running.
|
|
6
|
+
*/
|
|
7
|
+
export declare const postSuccessComment: (reference: Reference, context: Context) => Promise<void>;
|
|
8
|
+
//# sourceMappingURL=post-success-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-success-comment.d.ts","sourceRoot":"","sources":["../src/post-success-comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYjE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,WAAW,SAAS,EAAE,SAAS,OAAO,KAAG,OAAO,CAAC,IAAI,CAsH7F,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { inspect } from "node:util";
|
|
2
|
+
import { getIssueAndPullRequestToken } from "@release-change/ci";
|
|
3
|
+
import { setLogger } from "@release-change/logger";
|
|
4
|
+
import { formatDetailedError } from "@release-change/shared";
|
|
5
|
+
import { getRepositoryRelatedEntryPoint } from "./get-repository-related-entry-point.js";
|
|
6
|
+
import { linkifyReleaseInfo } from "./linkify-release-info.js";
|
|
7
|
+
/**
|
|
8
|
+
* Posts a success comment on the issue or the pull request to notify the release success.
|
|
9
|
+
* @param reference - The reference of the issue or pull request.
|
|
10
|
+
* @param context - The context where the CLI is running.
|
|
11
|
+
*/
|
|
12
|
+
export const postSuccessComment = async (reference, context) => {
|
|
13
|
+
const { env, config: { debug, isMonorepo, repositoryUrl }, nextRelease, releaseInfos } = context;
|
|
14
|
+
const logger = setLogger(debug);
|
|
15
|
+
logger.setScope("github");
|
|
16
|
+
if (nextRelease) {
|
|
17
|
+
const issuePullRequestToken = getIssueAndPullRequestToken(env);
|
|
18
|
+
const repositoryEntryPoint = getRepositoryRelatedEntryPoint(repositoryUrl);
|
|
19
|
+
const { number, isPullRequest, gitTags } = reference;
|
|
20
|
+
const uri = `${repositoryEntryPoint}/issues/${number}/comments`;
|
|
21
|
+
const versions = [];
|
|
22
|
+
const releaseInfosAvailabilities = [];
|
|
23
|
+
for (const gitTag of gitTags) {
|
|
24
|
+
const packageName = nextRelease.find(release => release.gitTag === gitTag)?.name;
|
|
25
|
+
const version = nextRelease.find(release => release.gitTag === gitTag)?.version;
|
|
26
|
+
if (typeof packageName === "undefined" || typeof version === "undefined")
|
|
27
|
+
continue;
|
|
28
|
+
const npmVersion = `/v/${version}`;
|
|
29
|
+
const versionReleaseInfos = releaseInfos.filter(releaseInfo => releaseInfo.url.endsWith(`/tag/${gitTag}`) ||
|
|
30
|
+
releaseInfo.url.endsWith(isMonorepo ? `/${packageName}${npmVersion}` : npmVersion));
|
|
31
|
+
const totalReleaseInfos = versionReleaseInfos.length;
|
|
32
|
+
const [firstReleaseInfo] = versionReleaseInfos;
|
|
33
|
+
const releaseInfosAvailability = `\n\nThe release is available on${totalReleaseInfos === 1
|
|
34
|
+
? firstReleaseInfo
|
|
35
|
+
? ` ${linkifyReleaseInfo(firstReleaseInfo)}`
|
|
36
|
+
: ""
|
|
37
|
+
: `:\n${new Intl.ListFormat("en-GB", { type: "unit" })
|
|
38
|
+
.format(versionReleaseInfos.map(versionReleaseInfo => `- ${linkifyReleaseInfo(versionReleaseInfo)}`))
|
|
39
|
+
.replaceAll(" - ", "\n- ")}`}.`;
|
|
40
|
+
if (isMonorepo) {
|
|
41
|
+
versions.push(`${version} of ${packageName || "root"} package`);
|
|
42
|
+
if (totalReleaseInfos)
|
|
43
|
+
releaseInfosAvailabilities.push(`\n\n##### ${packageName ? `${packageName}@` : ""}${version}${releaseInfosAvailability}`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
versions.push(version);
|
|
47
|
+
if (totalReleaseInfos)
|
|
48
|
+
releaseInfosAvailabilities.push(releaseInfosAvailability);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const totalVersions = versions.length;
|
|
52
|
+
const [firstVersion] = versions;
|
|
53
|
+
const versionEnumeration = totalVersions > 1
|
|
54
|
+
? `in versions ${new Intl.ListFormat("en-GB", { style: "long", type: "conjunction" }).format(versions)}`
|
|
55
|
+
: `in version ${firstVersion}`;
|
|
56
|
+
const commentSummary = totalVersions
|
|
57
|
+
? `This ${isPullRequest ? "pull request is included" : "issue has been resolved"} ${versionEnumeration}.`
|
|
58
|
+
: "";
|
|
59
|
+
const commentBody = `#### The release succeeded\n\n${commentSummary}${releaseInfosAvailabilities.join("")}`;
|
|
60
|
+
const requestBody = {
|
|
61
|
+
body: commentBody
|
|
62
|
+
};
|
|
63
|
+
const successCommentResponse = await fetch(uri, {
|
|
64
|
+
method: "POST",
|
|
65
|
+
headers: {
|
|
66
|
+
Accept: "application/vnd.github+json",
|
|
67
|
+
Authorization: `Bearer ${issuePullRequestToken}`,
|
|
68
|
+
"Content-Type": "application/json",
|
|
69
|
+
"X-GitHub-Api-Version": "2022-11-28"
|
|
70
|
+
},
|
|
71
|
+
body: JSON.stringify(requestBody)
|
|
72
|
+
});
|
|
73
|
+
const { headers, status, statusText } = successCommentResponse;
|
|
74
|
+
const issueType = isPullRequest ? "pull request" : "issue";
|
|
75
|
+
const successCommentResponseData = successCommentResponse.json();
|
|
76
|
+
if (debug) {
|
|
77
|
+
logger.setDebugScope("github:post-success-comment");
|
|
78
|
+
logger.logDebug(`API entry point: ${uri}`);
|
|
79
|
+
logger.logDebug(`Request body: ${inspect(requestBody, { depth: Number.POSITIVE_INFINITY })}`);
|
|
80
|
+
logger.logDebug(`Response status: ${status}`);
|
|
81
|
+
logger.logDebug(`Response status text: ${statusText}`);
|
|
82
|
+
logger.logDebug(`Response headers: ${inspect(headers, { depth: Number.POSITIVE_INFINITY })}`);
|
|
83
|
+
logger.logDebug(`Response JSON: ${inspect(await successCommentResponseData, { depth: Number.POSITIVE_INFINITY })}`);
|
|
84
|
+
}
|
|
85
|
+
if (status === 201)
|
|
86
|
+
logger.logSuccess(`Added success comment on ${issueType} #${number}.`);
|
|
87
|
+
else if (status === 404)
|
|
88
|
+
logger.logWarn(`The resource requested for ${issueType} #${number} has not been found; therefore, the success comment has not been added.`);
|
|
89
|
+
else {
|
|
90
|
+
const responseError = await successCommentResponseData;
|
|
91
|
+
const { message, documentation_url: documentationUrl } = responseError;
|
|
92
|
+
const documentationReference = documentationUrl ? ` See ${documentationUrl}.` : "";
|
|
93
|
+
logger.logError(`Failed to post the success comment on ${issueType} #${number}.`);
|
|
94
|
+
process.exitCode = status;
|
|
95
|
+
throw formatDetailedError({
|
|
96
|
+
title: "Failed to post the success comment",
|
|
97
|
+
message: `${message}${documentationReference}`,
|
|
98
|
+
details: {
|
|
99
|
+
output: `status: ${status}`
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
process.exitCode = 1;
|
|
106
|
+
throw formatDetailedError({
|
|
107
|
+
title: "Failed to post the success comment",
|
|
108
|
+
message: "The next release is not defined.",
|
|
109
|
+
details: {
|
|
110
|
+
output: "nextRelease: undefined"
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=post-success-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-success-comment.js","sourceRoot":"","sources":["../src/post-success-comment.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,C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AoC;gBAC3C,OAAO,EAAE,GAAG,OAAO,GAAG,sBAAsB,EAAE;gBAC9C,OAAO,EAAE;oBACP,MAAM,EAAE,WAAW,MAAM,EAAE;iBAC5B;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,oCAAoC;YAC3C,OAAO,EAAE,kCAAkC;YAC3C,OAAO,EAAE;gBACP,MAAM,EAAE,wBAAwB;aACjC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-pull-request-and-issue.d.ts","sourceRoot":"","sources":["../src/tag-pull-request-and-issue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYjE,eAAO,MAAM,sBAAsB,GACjC,WAAW,SAAS,EACpB,SAAS,OAAO,KACf,OAAO,CAAC,IAAI,CAsFd,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { inspect } from "node:util";
|
|
2
|
+
import { getIssueAndPullRequestToken } from "@release-change/ci";
|
|
3
|
+
import { setLogger } from "@release-change/logger";
|
|
4
|
+
import { agreeInNumber, formatDetailedError } from "@release-change/shared";
|
|
5
|
+
import { findNpmTagFromGitTag } from "./find-npm-tag-from-git-tag.js";
|
|
6
|
+
import { getRepositoryRelatedEntryPoint } from "./get-repository-related-entry-point.js";
|
|
7
|
+
export const tagPullRequestAndIssue = async (reference, context) => {
|
|
8
|
+
const { number, isPullRequest, gitTags } = reference;
|
|
9
|
+
const { env, config: { debug, repositoryUrl }, nextRelease } = context;
|
|
10
|
+
const logger = setLogger(debug);
|
|
11
|
+
logger.setScope("github");
|
|
12
|
+
if (nextRelease) {
|
|
13
|
+
const issuePullRequestToken = getIssueAndPullRequestToken(env);
|
|
14
|
+
const repositoryEntryPoint = getRepositoryRelatedEntryPoint(repositoryUrl);
|
|
15
|
+
const uri = `${repositoryEntryPoint}/issues/${number}`;
|
|
16
|
+
const requestBody = {
|
|
17
|
+
labels: [
|
|
18
|
+
...new Set(gitTags
|
|
19
|
+
.map(gitTag => findNpmTagFromGitTag(gitTag, nextRelease))
|
|
20
|
+
.filter(npmTag => npmTag !== null)
|
|
21
|
+
.map(npmTag => `released${npmTag ? ` on @${npmTag}` : ""}`))
|
|
22
|
+
]
|
|
23
|
+
};
|
|
24
|
+
const issueClosingResponse = await fetch(uri, {
|
|
25
|
+
method: "PATCH",
|
|
26
|
+
headers: {
|
|
27
|
+
Accept: "application/vnd.github+json",
|
|
28
|
+
Authorization: `Bearer ${issuePullRequestToken}`,
|
|
29
|
+
"Content-Type": "application/json",
|
|
30
|
+
"X-GitHub-Api-Version": "2022-11-28"
|
|
31
|
+
},
|
|
32
|
+
body: JSON.stringify(requestBody)
|
|
33
|
+
});
|
|
34
|
+
const { headers, status, statusText } = issueClosingResponse;
|
|
35
|
+
const issueClosingResponseData = issueClosingResponse.json();
|
|
36
|
+
if (debug) {
|
|
37
|
+
logger.setDebugScope("github:tag-pull-request-and-issue");
|
|
38
|
+
logger.logDebug(`API entry point: ${uri}`);
|
|
39
|
+
logger.logDebug(`Request body: ${inspect(requestBody, { depth: Number.POSITIVE_INFINITY })}`);
|
|
40
|
+
logger.logDebug(`Response status: ${status}`);
|
|
41
|
+
logger.logDebug(`Response status text: ${statusText}`);
|
|
42
|
+
logger.logDebug(`Response headers: ${inspect(headers, { depth: Number.POSITIVE_INFINITY })}`);
|
|
43
|
+
logger.logDebug(`Response JSON: ${inspect(await issueClosingResponseData, { depth: Number.POSITIVE_INFINITY })}`);
|
|
44
|
+
}
|
|
45
|
+
const issueType = isPullRequest ? "pull request" : "issue";
|
|
46
|
+
if (status === 200) {
|
|
47
|
+
const { labels } = requestBody;
|
|
48
|
+
const totalLabels = labels.length;
|
|
49
|
+
const labelEnumeration = new Intl.ListFormat("en-GB", {
|
|
50
|
+
style: "long",
|
|
51
|
+
type: "conjunction"
|
|
52
|
+
}).format(labels.map(label => `\`${label}\``));
|
|
53
|
+
const labelMessage = totalLabels
|
|
54
|
+
? ` with ${agreeInNumber(totalLabels, ["label", "labels"])} ${labelEnumeration}`
|
|
55
|
+
: "";
|
|
56
|
+
logger.logSuccess(`Tagged ${issueType} #${number} successfully${labelMessage}.`);
|
|
57
|
+
}
|
|
58
|
+
else if (status === 404) {
|
|
59
|
+
logger.logWarn(`The resource requested for ${issueType} #${number} has not been found; therefore, no labels have been added.`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const responseError = await issueClosingResponseData;
|
|
63
|
+
const { message, documentation_url: documentationUrl } = responseError;
|
|
64
|
+
const documentationReference = documentationUrl ? ` See ${documentationUrl}.` : "";
|
|
65
|
+
logger.logError(`Failed to tag ${issueType} #${number}.`);
|
|
66
|
+
process.exitCode = status;
|
|
67
|
+
throw formatDetailedError({
|
|
68
|
+
title: "Failed to tag the issue or pull request",
|
|
69
|
+
message: `${message}${documentationReference}`,
|
|
70
|
+
details: {
|
|
71
|
+
output: `status: ${status}`
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
process.exitCode = 1;
|
|
78
|
+
throw formatDetailedError({
|
|
79
|
+
title: "Failed to tag the issue or pull request",
|
|
80
|
+
message: "The next release is not defined.",
|
|
81
|
+
details: {
|
|
82
|
+
output: "nextRelease: undefined"
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=tag-pull-request-and-issue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-pull-request-and-issue.js","sourceRoot":"","sources":["../src/tag-pull-request-and-issue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;A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,OAAO,EAAE;oBACP,MAAM,EAAE,WAAW,MAAM,EAAE;iBAC5B;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,yCAAyC;YAChD,OAAO,EAAE,kCAAkC;YAC3C,OAAO,EAAE;gBACP,MAAM,EAAE,wBAAwB;aACjC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@release-change/github",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Functions used internally in release-change to publish a GitHub release and comment on released pull requests and issues",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"homepage": "https://github.com/release-change/release-change",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/release-change/release-change/issues"
|
|
9
|
+
},
|
|
10
|
+
"author": "Victor Brito (https://victor-brito.dev)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/release-change/release-change.git"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": "^20.18.3 || ^22.12.0 || ^24.0.0",
|
|
26
|
+
"npm": ">=10.8.2",
|
|
27
|
+
"pnpm": ">=10.28.0"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@release-change/ci": "0.1.0",
|
|
31
|
+
"@release-change/commit-analyser": "0.1.0",
|
|
32
|
+
"@release-change/config": "0.1.0",
|
|
33
|
+
"@release-change/logger": "0.1.0",
|
|
34
|
+
"@release-change/shared": "0.1.0"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"dev": "tsc --watch --preserveWatchOutput & vitest"
|
|
39
|
+
}
|
|
40
|
+
}
|