Skip to content

Commit

Permalink
feat(gha): Add support for collapsing of output when run in Github Ac…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
christopherthielen committed Dec 27, 2019
1 parent d9201a1 commit 89d50e0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test_downstream_projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const path = require('path');
const tmp = require('tmp');
const shelljs = require('shelljs');
const _ = require('lodash');
const IS_TRAVIS = !!process.env.TRAVIS;
const isTravis = !!process.env.TRAVIS;
const isGithubActions = !!process.env.GITHUB_ACTIONS;

const yargs = require('yargs')
.option('group', {
Expand All @@ -20,9 +21,14 @@ const yargs = require('yargs')
const nodeCleanup = require('node-cleanup');
const publishYalcPackage = require('./publish_yalc_package');
const foldStart = (message) => {
IS_TRAVIS && console.log('travis_fold:start:' + message.replace(/\s+/g, '.'));
isTravis && console.log('travis_fold:start:' + message.replace(/\s+/g, '.'));
isGithubActions && console.log('::group::' + message);
console.log(message);
return () => IS_TRAVIS && console.log('travis_fold:end:' + message.replace(/\s+/g, '.'));
return () => {
isTravis && console.log('travis_fold:end:' + message.replace(/\s+/g, '.'));
isGithubActions && console.log(message);
isGithubActions && console.log('::endgroup::');
};
};
let foldEnd = () => null;

Expand Down

0 comments on commit 89d50e0

Please sign in to comment.