(comments)
| 45 | |
| 46 | // Helper function to insert comments into Google Sheets |
| 47 | function insertCommentsToSheet(comments) { |
| 48 | const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); |
| 49 | |
| 50 | // Insert header at row 5 and apply formatting |
| 51 | const headerRange = sheet.getRange(5, 1, 1, 3); |
| 52 | headerRange.setValues([['Author', 'Comment', 'Published At']]); |
| 53 | headerRange.setFontWeight('bold'); // Make headers bold |
| 54 | headerRange.setBackground('#f0f0f0'); // Light grey background for headers |
| 55 | headerRange.setHorizontalAlignment('center'); // Center align headers |
| 56 | |
| 57 | // Insert comments starting from row 5 |
| 58 | if (comments.length > 0) { |
| 59 | sheet.getRange(6, 1, comments.length, comments[0].length).setValues(comments); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | function auth() { |
| 64 | cache = CacheService.getUserCache(); |
no outgoing calls
no test coverage detected