Skip to content

Commit b832bab

Browse files
d2m (#2922)
* chore: update workflow debug @semantic-release/github * chore: update workflow debug @semantic-release/github * chore: update workflow debug @semantic-release/github * chore: update .npmignore * fix: [en-AU] locale use the same ordinal as moment (#2878) The en-AU locale wasn't using ordinal at all. It should follow the same as the other English languages. Co-authored-by: iamkun <kunhello@outlook.com> --------- Co-authored-by: Patrick O'Meara <pat@maintainly.com>
2 parents 960170d + 1b95ecd commit b832bab

File tree

3 files changed

+9
-67
lines changed

3 files changed

+9
-67
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ build
2020
babel.config.js
2121
prettier.config.js
2222
.eslintrc.json
23+
patches
2324

2425
#doc
2526
CONTRIBUTING.md
Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,13 @@
11
diff --git a/node_modules/@semantic-release/github/lib/success.js b/node_modules/@semantic-release/github/lib/success.js
2-
index 29c8def..576c68a 100644
2+
index 29c8def..7e57161 100644
33
--- a/node_modules/@semantic-release/github/lib/success.js
44
+++ b/node_modules/@semantic-release/github/lib/success.js
5-
@@ -15,6 +15,8 @@ import getReleaseLinks from "./get-release-links.js";
6-
const debug = debugFactory("semantic-release:github");
7-
8-
export default async function success(pluginConfig, context, { Octokit }) {
9-
+ console.log('pluginConfig: ', pluginConfig);
10-
+ console.log('context: ', context);
11-
const {
12-
options: { repositoryUrl },
13-
commits,
14-
@@ -37,6 +39,21 @@ export default async function success(pluginConfig, context, { Octokit }) {
15-
releasedLabels,
16-
addReleases,
17-
} = resolveConfig(pluginConfig, context);
18-
+ console.log('resolveConfig', {
19-
+ githubToken,
20-
+ githubUrl,
21-
+ githubApiPathPrefix,
22-
+ githubApiUrl,
23-
+ proxy,
24-
+ labels,
25-
+ successComment,
26-
+ successCommentCondition,
27-
+ failTitle,
28-
+ failComment,
29-
+ failCommentCondition,
30-
+ releasedLabels,
31-
+ addReleases,
32-
+ })
33-
34-
const octokit = new Octokit(
35-
toOctokitOptions({
36-
@@ -74,17 +91,21 @@ export default async function success(pluginConfig, context, { Octokit }) {
37-
);
38-
const releaseInfos = releases.filter((release) => Boolean(release.name));
39-
const shas = commits.map(({ hash }) => hash);
40-
+ console.log('shas: ', shas);
41-
42-
// Get associatedPRs
43-
const associatedPRs = await inChunks(shas, 100, async (chunk) => {
44-
+ console.log('chunk: ', chunk);
45-
const responsePRs = [];
46-
const { repository } = await octokit.graphql(
47-
buildAssociatedPRsQuery(chunk),
48-
{ owner, repo },
49-
);
50-
+ console.log('repository: ', repository);
51-
const responseAssociatedPRs = Object.values(repository).map(
52-
(item) => item.associatedPullRequests,
53-
);
54-
+ console.log('responseAssociatedPRs: ', responseAssociatedPRs);
55-
for (const { nodes, pageInfo } of responseAssociatedPRs) {
56-
if (nodes.length === 0) continue;
57-
58-
@@ -116,8 +137,10 @@ export default async function success(pluginConfig, context, { Octokit }) {
59-
});
60-
5+
@@ -118,6 +118,8 @@ export default async function success(pluginConfig, context, { Octokit }) {
616
const uniqueAssociatedPRs = uniqBy(flatten(associatedPRs), "number");
62-
+ console.log('uniqueAssociatedPRs: ', uniqueAssociatedPRs);
637

648
const prs = await pFilter(uniqueAssociatedPRs, async ({ number }) => {
659
+ console.log('number: ', number);
10+
+ if (number < 2000) return false;
6611
const commits = await octokit.paginate(
6712
"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
6813
{
69-
@@ -539,6 +562,7 @@ const loadSingleCommitAssociatedPRs = `#graphql
70-
* @returns {object[]}
71-
*/
72-
function buildIssuesOrPRsFromResponseNode(responseNodes) {
73-
+ console.log('responseNodes: ', responseNodes);
74-
const resultArray = [];
75-
for (const node of responseNodes) {
76-
let baseProps = {

src/locale/en-au.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const locale = {
99
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
1010
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
1111
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
12-
ordinal: n => n,
1312
formats: {
1413
LT: 'h:mm A',
1514
LTS: 'h:mm:ss A',
@@ -32,6 +31,11 @@ const locale = {
3231
MM: '%d months',
3332
y: 'a year',
3433
yy: '%d years'
34+
},
35+
ordinal: (n) => {
36+
const s = ['th', 'st', 'nd', 'rd']
37+
const v = n % 100
38+
return `[${n}${(s[(v - 20) % 10] || s[v] || s[0])}]`
3539
}
3640
}
3741

0 commit comments

Comments
 (0)