Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.01 KB

scripting.md

File metadata and controls

37 lines (26 loc) · 1.01 KB

Scripting Guide

This guide explains the basics of events available to brigade.js files.

For more, see the Brigade Scripting Guide

Brigade GitLab Events

Brigade listens for certain things to happen, this gateway provides those such events from a GitLab repository. The events that Brigade listens for are configured in your project.

When Brigade observes such an event, it will load the brigade.js file and see if there is an event handler that matches the event.

For example:

const { events } = require("brigadier")

events.on("push", () => {
  console.log("==> handling an 'push' event")
})

The GitLab Gateway produces 8 events:

push
tag
issue
comment
mergerequest
wikipage
pipeline
build

These are based on the events described in the GitLab Webhooks API guide. Note the Issue and ConfidentialIssue events are treated the same as an issue event.