--- title: "TravisCI" slug: "travisci" updated: 2024-07-25T12:33:59Z published: 2024-07-25T12:33:59Z canonical: "docs.rocket.chat/travisci" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # TravisCI Add TravisCI notifications via a new webhook in Rocket.Chat ## Receive alerts 1. Create a new **Incoming WebHook**. 2. Select the channel where you will receive the alerts. You may wish to create a dedicated channel for your notifications. 3. Select an account from which the alerts will be posted. You may wish to create a dedicated account just for notifications. 4. Set the "Enable Scripts" option to `True`. 5. Copy scripts below and paste it in Script field. 6. Save the integration. This will generate a webhook URL and secret for you. 7. In your `.travis.yml` file add WebHooks parameter with webhook URL generated. ```yaml  notifications:      webhooks: ``` This script will generate notifications for the following build events: - Build finished status for any pushed code - Build finished status for new Pull Request ![](https://cdn.us.document360.io/6ae79a05-7252-45d0-96e8-8f375e07b1b2/Images/Documentation/Screenshot of messages generated by TravisCI integration script.avif)Screenshot of messages generated by TravisCI integration script Note: If the status is passed, the message color is green; otherwise, it is red. ```javascript const buildMessage = (obj) => {  const min = Math.floor(obj.duration / 60);  const sec = obj.duration - min * 60;  let template = `Build [#${obj.number}](${obj.build_url})`;  template += ` ([${obj.commit.substring(0, 7)}](${obj.compare_url})) of`  template += ` ${obj.repository.owner_name}/${obj.repository.name}@${obj.branch}`;  if(obj.pull_request) {     let pr_url = `https://github.com/${obj.repository.owner_name}/`;     pr_url += `${obj.repository.name}/pull/${obj.pull_request_number}`;     template += ` in PR [#${obj.pull_request_number}](${pr_url})`;  }  template += ` by ${obj.author_name} ${obj.state} in ${min} min ${sec} sec`;  let status_color = '#36A64F';  if(obj.state !== 'passed') {    status_color = '#A63636'  }  return {    text: template,    color: status_color  }; }; class Script {  process_incoming_request({ request }) {    msg = buildMessage(request.content);    return {      content:{        attachments: [          {            text: msg.text,            color: msg.color          }        ]      }    };  } } ``` For more customizations, see the [TravisCI documentation](https://docs.travis-ci.com/user/notifications/#Configuring-webhook-notifications).