🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

octoturtle

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

octoturtle

Set up auditing rules for your Github repository

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Octoturtle

Build Status Coverage Status Dependency Freshness

Octoturtle is a dead simple fluent library for responding to Github webhooks. Primarily inspired by Docker's awesome issue and PR auditor @GordonTheTurtle, Octoturtle seeks to make it easy for any repository owner to specify and enforce a set of rules for contributing to a repository.

Here's a simple Octoturtle rule based on Docker's #dibs policy for claiming issues:

const octoturtle = require('octoturtle');
const config = require('./config.json');

const whenAn = octoturtle;
const github = new octoturtle.Github(config.GITHUB_USER, config.GITHUB_TOKEN);

const hook = whenAn('issues').is('opened').to('octoturtle');

/**
 * Checks if the body of the item contains the string "dibs".
 * @param {String} event The type of event
 * @param {Payload} payload The hook payload
 */
function bodyContainsDibs(event, payload) {
  payload.getIssueBody().includes('dibs');
}

hook.if(bodyContainsDibs, github.applyLabels(['dibs']));

Installation

You can deploy your own Octoturtle auditor easily using either Express or with Lambda using Gordon.

First, install Yeoman and generator-octoturtle using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-octoturtle

Then generate your new auditor:

yo octoturtle

Keywords

github

FAQs

Package last updated on 21 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts