Skip to content

Commit cf09263

Browse files
build(release): compile new build 2.3.0 [skip ci]
1 parent 1e81d36 commit cf09263

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

dist/index.js

+24-12
Original file line numberDiff line numberDiff line change
@@ -103177,34 +103177,46 @@ function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
103177103177
return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
103178103178
}
103179103179

103180-
/* eslint-disable camelcase */
103181-
async function pull_request (octokit, {
103182-
changedRepositories,
103183-
localFiles
103184-
}) {
103185-
const output = ['## Template Repository Sync Report'];
103180+
const header = '## Template Repository Sync Report';
103181+
function report (changedRepositories, localFiles) {
103182+
const output = [header, ''];
103186103183

103187103184
if (changedRepositories.size === 0) {
103188103185
output.push('> no changes to sync');
103189103186
} else {
103190103187
const count = [...changedRepositories.values()].map(x => [...x.values()]).flat().length;
103191-
output.push(`> Found ${count} files to update in ${changedRepositories.size} repositories`, '');
103188+
output.push(`> Found ${count} file${count > 1 ? 's' : ''} to update in ${changedRepositories.size} repositories`, '');
103192103189

103193103190
for (const [repo, remoteFiles] of changedRepositories.entries()) {
103194-
output.push(`<details><summary>${repo} <a target="_blank" href="/${github$1.context.repo.owner}/${repo}">🔗</a></summary>`, '');
103191+
output.push(`### [${repo}](/${github$1.context.repo.owner}/${repo})`, '');
103195103192

103196103193
for (const [path, remoteContent] of remoteFiles.entries()) {
103197103194
const before = remoteContent.toString('utf8');
103198103195
const after = localFiles.get(path).toString('utf8');
103199103196
const patch = createPatch(path, before, after);
103200-
output.push('```diff', patch, '```', '', '');
103197+
output.push(`<details><summary><code>${path}</code></summary>`, '');
103198+
output.push('```diff', patch.split('\n').splice(2).join('\n'), '```', '');
103199+
output.push('</details>', '');
103201103200
}
103202-
103203-
output.push('</details>', '');
103204103201
}
103205103202
}
103206103203

103207103204
const body = output.join('\n');
103205+
return {
103206+
header,
103207+
body
103208+
};
103209+
}
103210+
103211+
/* eslint-disable camelcase */
103212+
async function pull_request (octokit, {
103213+
changedRepositories,
103214+
localFiles
103215+
}) {
103216+
const {
103217+
header,
103218+
body
103219+
} = report(changedRepositories, localFiles);
103208103220
const {
103209103221
issue: {
103210103222
number: issue_number
@@ -103217,7 +103229,7 @@ async function pull_request (octokit, {
103217103229
issue_number
103218103230
}); // find existing comment
103219103231

103220-
const old = comments.find(comment => comment.body.includes('## Template Repository Sync Report')); // update PR
103232+
const old = comments.find(comment => comment.body.includes(header)); // update PR
103221103233

103222103234
if (old) {
103223103235
await octokit.rest.issues.updateComment({ ...github$1.context.repo,

0 commit comments

Comments
 (0)