No commit activity in last 3 years
No release in over 3 years
Check whether a GitHub commit is counted as a contribution for a specific GitHub user.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 4.0
 Project Readme

GitHub Contribution Checker

People ❤️ GitHub Contributions. However, it's not always simple to tell why a commit isn't counted as a contribution. This library lets you check whether a specific commit qualifies as a contribution.

Developing

To start working on the project:

script/bootstrap

To run the specs:

script/test

Usage

require "contribution-checker"

checker = ContributionChecker::Checker.new \
  :access_token => "<Your 40 char GitHub API token>",
  :commit_url   => "https://github.com/user/repo/commit/sha"

checker.check
=> {
  :contribution => true,
  :and_criteria => {
    :commit_email_is_not_generic => true,
    :commit_in_valid_branch      => true,
    :repo_not_a_fork             => true,
    :commit_email_linked_to_user => true,
    :commit_email                => "me@foo.com",
    :default_branch              => "master"
  },
  :or_criteria => {
    :user_has_starred_repo               => false,
    :user_can_push_to_repo               => false,
    :user_is_repo_org_member             => true,
    :user_has_fork_of_repo               => false,
    :user_has_opened_issue_or_pr_in_repo => false
  }
}

App

You might like to try out the Contribution Checker app built on top of this library:

checker

The source for the app is in jdennes/contribution-checker-app.

Created by @izuzak and @jdennes at the Hamburg Hackathon, June 2014.