Skip to content

Commit

Permalink
Merge branch 'github:main-enterprise' into Environments-tolerate-conc…
Browse files Browse the repository at this point in the history
…ise-config
  • Loading branch information
Brad-Abrams authored Jun 26, 2024
2 parents 8d369c0 + 35b2ac4 commit 3381ecb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 4 additions & 6 deletions lib/commentmessage.eta → lib/commentmessage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
* Run on: `<%= new Date() %>`
module.exports = `* Run on: \` <%= new Date() %> \`
* Number of repos that were considered: `<%= Object.keys(it.reposProcessed).length %>`
* Number of repos that were considered: \`<%= Object.keys(it.reposProcessed).length %> \`
### Breakdown of changes
| Repo <% Object.keys(it.changes).forEach(plugin => { %> | <%= plugin %> settings <% }) %> |
Expand All @@ -19,7 +19,7 @@
### Breakdown of errors
<% if (Object.keys(it.errors).length === 0) { %>
`None`
\`None\`
<% } else { %>
<% Object.keys(it.errors).forEach(repo => { %>
<%_= repo %>:
Expand All @@ -28,6 +28,4 @@
<% }) %>
<% }) %>
<% } %>


<% } %>`
3 changes: 2 additions & 1 deletion lib/error.eta → lib/error.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Run on: `<%= new Date().toISOString() %>`
module.exports = `Run on: \`<%= new Date().toISOString() %>\`
#### Breakdown of Errors
| Owner| Repo | Plugin | Error
Expand All @@ -9,3 +9,4 @@ Run on: `<%= new Date().toISOString() %>`
<% }) -%>
`
8 changes: 5 additions & 3 deletions lib/settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path')
const { Eta } = require('eta')
const commetMessageTemplate = require('./commentmessage')
const errorTemplate = require('./error')
const Glob = require('./glob')
const NopCommand = require('./nopcommand')
const MergeDeep = require('./mergeDeep')
Expand Down Expand Up @@ -103,7 +105,7 @@ class Settings {
if (this.errors.length > 0) {
conclusion = 'failure'
summary = 'Safe-Settings finished with errors.'
details = await eta.render('./error', this.errors)
details = await eta.renderString(errorTemplate, this.errors)
}

// Use the latest commit to create the check against
Expand Down Expand Up @@ -217,7 +219,7 @@ class Settings {
<tbody>
`

const commentmessage = await eta.render('./commentmessage', stats)
const renderedCommentMessage = await eta.renderString(commetMessageTemplate, stats)

if (env.CREATE_PR_COMMENT === 'true') {
const summary = `
Expand Down Expand Up @@ -262,7 +264,7 @@ ${this.results.reduce((x, y) => {
completed_at: new Date().toISOString(),
output: {
title: error ? 'Safe-Settings Dry-Run Finished with Error' : 'Safe-Settings Dry-Run Finished with success',
summary: commentmessage.length > 55536 ? `${commentmessage.substring(0, 55536)}... (too many changes to report)` : commentmessage
summary: renderedCommentMessage.length > 55536 ? `${renderedCommentMessage.substring(0, 55536)}... (too many changes to report)` : renderedCommentMessage
}
}

Expand Down

0 comments on commit 3381ecb

Please sign in to comment.