Skip to content

Commit 822eed5

Browse files
authored
Merge pull request #12 from hothsys/pr-summary-fix
Update pr-summary.yml
2 parents 30e7d87 + 00faf1c commit 822eed5

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

.github/workflows/pr-summary.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,26 @@ jobs:
3434
pull_number: prNumber,
3535
});
3636
37-
const summary = `## 📋 PR Summary
38-
39-
**Title:** ${pr.title}
40-
**Author:** @${pr.user.login}
41-
**State:** ${pr.state.toUpperCase()}
42-
**Draft:** ${pr.draft ? 'Yes' : 'No'}
43-
44-
### Changes
45-
- **Commits:** ${commits.length}
46-
- **Files Changed:** ${files.length}
47-
- **Additions:** +${pr.additions}
48-
- **Deletions:** -${pr.deletions}
49-
50-
### Files Modified
51-
${files.slice(0, 10).map(f => `- \`${f.filename}\` (${f.changes} changes)`).join('\n')}
52-
${files.length > 10 ? `- ... and ${files.length - 10} more files` : ''}
53-
54-
${pr.body ? `### Description\n${pr.body}` : ''}`;
37+
const summary = [
38+
'## 📋 PR Summary',
39+
'',
40+
`**Title:** ${pr.title}`,
41+
`**Author:** @${pr.user.login}`,
42+
`**State:** ${pr.state.toUpperCase()}`,
43+
`**Draft:** ${pr.draft ? 'Yes' : 'No'}`,
44+
'',
45+
'### Changes',
46+
`- **Commits:** ${commits.length}`,
47+
`- **Files Changed:** ${files.length}`,
48+
`- **Additions:** +${pr.additions}`,
49+
`- **Deletions:** -${pr.deletions}`,
50+
'',
51+
'### Files Modified',
52+
...files.slice(0, 10).map(f => `- \`${f.filename}\` (${f.changes} changes)`),
53+
files.length > 10 ? `- ... and ${files.length - 10} more files` : '',
54+
'',
55+
pr.body ? `### Description\n${pr.body}` : '',
56+
].filter(Boolean).join('\n');
5557
5658
await github.rest.issues.createComment({
5759
issue_number: prNumber,

0 commit comments

Comments
 (0)