Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.
/ enforcer Public archive

You laugh at me, you bastard, and I'll shoot you where you stand.

License

Notifications You must be signed in to change notification settings

thoughtbot/enforcer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED

thoughtbot is no longer supporting this project, it hasn’t been tested or used since GitHub introduced Organizations (github.com/blog/674-introducing-organizations).

enforcer

A simple way to manage permissions on GitHub.

usage

Create an enforcer script and then run it with the “enforcer” executable.

enforcer my_enforcer_script.rb

howto

The DSL should be formed like such:

Enforcer "your github account", "your github api key" do
  project "project", "user1", "user2", "user3"

  postreceive "project", "http://rdoc.info/projects/update",
                         "http://example.com/post"
end

The users passed into the project are then set as the collaborators. Any users not listed are removed. You can also set postreceive URLs as well.

advanced

You could use a GitHub API wrapper like Octopi to load up your projects. Here’s a more complex example:

require 'octopi'
include Octopi
account = "thoughtbot"
token   = "deadbeef"

Enforcer account, token do
  authenticated_with account, token do |github|
    @projects = github.user.repositories.map { |repo| repo.name }.sort
  end

  users = %w[user1 user2 user3]

  @projects.each do |name|
    project name, *users
  end
end

Copyright © 2009 thoughtbot. See LICENSE for details.

About

You laugh at me, you bastard, and I'll shoot you where you stand.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages