Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Commit

Permalink
add option to comment build log for successful builds (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rechi authored and bluzi committed Jan 26, 2019
1 parent 20d8de1 commit 7edaef2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Key | Description | Values
regex | Tells TravisBuddy to take only parts of the log. The regex is executed on each test script separately, and TravisBuddy will only show the first result catched using parentheses | Any valid regular expression
regexOptions | Use along with `regex` to apply regular expression options | Any valid regular expression option, i.e. `g`
insertMode | Tells TravisBuddy to comment once and keep editing that one comment instead of appending new comment for every build | (default) `append` or `update`
successBuildLog | Tells TravisBuddy to add the build log for successfull builds. | (default) `false` or `true`

#### Custom Template

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions pipes/finish.pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const finish = context => {
link: context.link,
language: context.language,
insertMode: context.config.insertMode,
successBuildLog: context.config.successBuildLog,
commentId: context.commentId,
buildNumber: context.buildNumber,
payload: JSON.stringify(context.payload, null, 4),
Expand Down
8 changes: 4 additions & 4 deletions pipes/format-message.pipe.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const paipu = require('paipu');
const mustache = require('mustache');
const collectFailureData = require('./collect-failure-data.pipe');
const collectBuildData = require('./collect-build-data.pipe');
const fetchTemplate = require('./fetch-template.pipe');
const logger = require('../utils/logger');

Expand Down Expand Up @@ -47,9 +47,9 @@ const formatMessage = async context => {

module.exports = paipu
.pipeIf(
context => context.state === 'failed',
'collect failure data',
collectFailureData,
context => context.state === 'failed' || (context.query.successBuildLog || context.config.successBuildLog) === 'true',
'collect build data',
collectBuildData,
)
.pipe('fetch template', fetchTemplate)
.pipe('format message', formatMessage);
1 change: 1 addition & 0 deletions resources/default-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ travisBuddy:
success: default
failure: default
insertMode: append
successBuildLog: false

0 comments on commit 7edaef2

Please sign in to comment.