Skip to content

Commit

Permalink
Merge pull request #100 from zotoio/feature/welcome-message
Browse files Browse the repository at this point in the history
fix(agent): Allow config to toggle welcome message
  • Loading branch information
Neko-Design authored Apr 17, 2018
2 parents b2509c4 + ae038ad commit 62bc71a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .envExample
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ GTM_DYNAMO_TABLE_EVENTS=GtmEvents
GTM_AWS_VPC_ID=<redacted>
GTM_BASE_URL=http://localhost:9091
GTM_S3_DEPENDENCY_BUCKET=gtmstorage
GTM_WELCOME_MESSAGE_ENABLED=true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Create an asynchronous CI agnostic mechanism for running custom test stage gates
|GTM_DYNAMO_TABLE_EVENTS| DynamoDB table to store event summaries |
|GTM_AWS_VPC_ID| vpc id - only required for ddb endpoints |
|GTM_BASE_URL| Base url used to render links to agent ui - eg elb cname |
|GTM_WELCOME_MESSAGE_ENABLED| If not 'false', send a warning message on unconfigured repository pull requests |


## Configure and deploy
Expand Down
5 changes: 4 additions & 1 deletion src/handlers/EventHandlerPullRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export class EventHandlerPullRequest extends EventHandler {

promises.push(AgentUtils.postResultsAndTrigger(eventStatus, `Executing event: ${event.eventId}`, log));

if (event.taskConfig.pull_request.isDefaultConfig) {
// Only send the welcome message if variable is not 'false'
let showWelcomeMessage = process.env.GTM_WELCOME_MESSAGE_ENABLED !== 'false';

if (event.taskConfig.pull_request.isDefaultConfig && showWelcomeMessage) {
let warningPath =
process.env.GTM_TASK_CONFIG_DEFAULT_MESSAGE_PATH || __dirname + '/PullRequestDefaultConfigWarning.md';

Expand Down

0 comments on commit 62bc71a

Please sign in to comment.