|
50 | 50 | // ------------------------------------------------- |
51 | 51 | if (context.eventName === 'issues' && context.payload.action === 'opened') { |
52 | 52 | console.log('Creating initial comment for review status'); |
53 | | - const body = `# RFC approval status: Pending\n\nCore team approvers:\nRejection from:\nAwaiting approval from:`; |
| 53 | + const body = `## RFC approval status: 🕐 Pending\n\nCore team approvers:\nRejection from: -\nAwaiting approval from:`; |
54 | 54 |
|
55 | 55 | await github.rest.issues.createComment({ |
56 | 56 | owner: org, |
@@ -97,13 +97,16 @@ jobs: |
97 | 97 | console.log(`Rejections (${rejections.size}):`, [...rejections]); |
98 | 98 |
|
99 | 99 | const awaiting = teamMembers.filter(u => !approvals.has(u) && !rejections.has(u)); |
100 | | - const status = approvals.size >= quorum && rejections.size === 0 ? 'Approved' : 'Pending'; |
| 100 | + const status = approvals.size >= quorum && rejections.size === 0 ? '✅ Approved' : '🕐 Pending'; |
101 | 101 |
|
102 | | - const statusBody = `# RFC approval status: ${status}\n\nCore team approvers: ${approvals.size ? [...approvals].join(', ') : 'None'}\nRejection from: ${rejections.size ? [...rejections].join(', ') : 'None'}\nAwaiting approval from: ${awaiting.length ? awaiting.join(', ') : 'None'}`; |
| 102 | + function formatUserList(users) { |
| 103 | + return users.length ? users.map(u => `[@${u}](https://github.com/${u})`).join(', ') : '-'; |
| 104 | + } |
| 105 | + const statusBody = `## RFC approval status: ${status}\n\nCore team approvers: ${formatUserList([...approvals])}\nRejection from: ${formatUserList([...rejections])}\nAwaiting approval from: ${formatUserList(awaiting)}`; |
103 | 106 | console.log('New status body to post:\n', statusBody); |
104 | 107 |
|
105 | 108 | // Try to locate the existing status comment (starts with our header) |
106 | | - let statusComment = comments.find(c => c.body.startsWith('# RFC approval status:')); |
| 109 | + let statusComment = comments.find(c => c.body.startsWith('## RFC approval status:')); |
107 | 110 |
|
108 | 111 | if (statusComment) { |
109 | 112 | await github.rest.issues.updateComment({ |
|
0 commit comments