@@ -103177,34 +103177,46 @@ function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
103177
103177
return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
103178
103178
}
103179
103179
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, ''];
103186
103183
103187
103184
if (changedRepositories.size === 0) {
103188
103185
output.push('> no changes to sync');
103189
103186
} else {
103190
103187
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`, '');
103192
103189
103193
103190
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}) `, '');
103195
103192
103196
103193
for (const [path, remoteContent] of remoteFiles.entries()) {
103197
103194
const before = remoteContent.toString('utf8');
103198
103195
const after = localFiles.get(path).toString('utf8');
103199
103196
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>', '');
103201
103200
}
103202
-
103203
- output.push('</details>', '');
103204
103201
}
103205
103202
}
103206
103203
103207
103204
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);
103208
103220
const {
103209
103221
issue: {
103210
103222
number: issue_number
@@ -103217,7 +103229,7 @@ async function pull_request (octokit, {
103217
103229
issue_number
103218
103230
}); // find existing comment
103219
103231
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
103221
103233
103222
103234
if (old) {
103223
103235
await octokit.rest.issues.updateComment({ ...github$1.context.repo,
0 commit comments