├── .ruby-version
├── vendor
├── .require_paths
└── cache
│ ├── i18n-0.9.1.gem
│ ├── json-1.8.6.gem
│ ├── jwt-2.1.0.gem
│ ├── mail-2.7.0.gem
│ ├── mash-0.1.1.gem
│ ├── mqtt-0.0.8.gem
│ ├── unf-0.1.4.gem
│ ├── builder-3.2.3.gem
│ ├── faraday-0.9.0.gem
│ ├── hashie-2.1.2.gem
│ ├── maxcdn-0.3.2.gem
│ ├── netrc-0.11.0.gem
│ ├── oauth-0.4.4.gem
│ ├── rake-10.0.3.gem
│ ├── signet-0.8.1.gem
│ ├── tinder-1.10.0.gem
│ ├── tzinfo-1.2.4.gem
│ ├── xmlrpc-0.2.1.gem
│ ├── xmpp4r-0.5.6.gem
│ ├── aws-sdk-1.67.0.gem
│ ├── jmespath-1.3.1.gem
│ ├── mini_mime-1.0.0.gem
│ ├── minitest-5.10.3.gem
│ ├── nokogiri-1.8.1.gem
│ ├── ruby-hmac-0.4.0.gem
│ ├── unf_ext-0.0.7.4.gem
│ ├── yajl-ruby-1.3.1.gem
│ ├── activemodel-4.2.10.gem
│ ├── addressable-2.5.2.gem
│ ├── aws-sdk-v1-1.67.0.gem
│ ├── eventmachine-1.2.5.gem
│ ├── http-cookie-1.0.3.gem
│ ├── mime-types-1.25.1.gem
│ ├── multi_json-1.12.2.gem
│ ├── rest-client-2.0.2.gem
│ ├── simple_oauth-0.1.9.gem
│ ├── thread_safe-0.3.6.gem
│ ├── twilio-ruby-3.9.0.gem
│ ├── xml-simple-1.0.11.gem
│ ├── activeresource-4.0.0.gem
│ ├── activesupport-4.2.10.gem
│ ├── aws-sdk-core-2.0.48.gem
│ ├── http_parser.rb-0.5.3.gem
│ ├── mini_portile2-2.3.0.gem
│ ├── multipart-post-2.0.0.gem
│ ├── public_suffix-3.0.1.gem
│ ├── concurrent-ruby-1.0.5.gem
│ ├── rails-observers-0.1.5.gem
│ ├── twitter-stream-0.1.16.gem
│ ├── domain_name-0.5.20170404.gem
│ ├── faraday_middleware-0.12.2.gem
│ ├── net-http-persistent-2.9.4.gem
│ └── softlayer_messaging-1.0.2.gem
├── docs
├── readthedocs
├── djangopackages
├── habitualist
├── kanbanery
├── statusnet
├── harvest
├── rdocinfo
├── apropos
├── bugherd
├── planbox
├── toggl
├── tender
├── mantisbt
├── jabber
├── getlocalization
├── grove
├── email
├── piwikplugins
├── trac
├── activecollab
├── conductor
├── webtranslateit
├── gemnasium
├── snowyevening
├── talker
├── basecamp
├── jaconda
├── pivotaltracker
├── typetalk
├── deployervc
├── weblate
├── lingohub
├── ironworker
├── gemini
├── acunote
├── jenkins
├── leanpub
├── huboard
├── deployhq
├── hostedgraphite
├── ironmq
├── travis
├── prowl
├── softlayermessaging
├── copperegg
├── backlog
├── pushover
├── windowsazure
├── firebase
├── landscape
├── phraseapp
├── sprintly
├── cia
├── codereviewhub
├── lighthouse
├── campfire
├── unfuddle
├── irker
├── packagist
├── divecloud
├── zohoprojects
├── scrumdo
├── gitter
├── apiary
├── freckle
├── sifter
├── appharbor
├── fisheye
├── smartling
├── sqsqueue
├── twilio
├── pushbullet
├── myget
├── kanbanize
├── skydeskprojects
├── zendesk
├── twitter
├── flowdock
├── tddium
├── simperium
├── jira
├── asana
├── commandoio
├── gocd
├── autodeploy
├── codeclimate
├── ibmdevopsservices
├── trello
├── bamboo
├── mqttpub
├── codeship
├── docker
├── jenkinsgit
├── maxcdn
├── crocagile
├── amazonsns
├── targetprocess
└── humbug
├── config
├── console.rb
├── email.yml
├── secrets.yml.example
└── load.rb
├── .github
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
└── CONTRIBUTING.md
├── script
├── test
├── console
├── package
├── cibuild
├── update_github
└── bootstrap
├── .travis.yml
├── Gemfile
├── lib
├── services
│ ├── read_the_docs.rb
│ ├── habitualist.rb
│ ├── web_translate_it.rb
│ ├── acunote.rb
│ ├── snowyevening.rb
│ ├── hostedgraphite.rb
│ ├── rdocinfo.rb
│ ├── planio.rb
│ ├── trac.rb
│ ├── bugherd.rb
│ ├── planbox.rb
│ ├── grove.rb
│ ├── http_post.rb
│ ├── codereviewhub.rb
│ ├── piwik_plugins.rb
│ ├── zohoprojects.rb
│ ├── kanbanery.rb
│ ├── landscape.rb
│ ├── get_localization.rb
│ ├── conductor.rb
│ ├── djangopackages.rb
│ ├── myget.rb
│ ├── scrumdo.rb
│ ├── docker.rb
│ ├── jenkins_github.rb
│ ├── mantis_bt.rb
│ ├── huboard.rb
│ ├── codeclimate.rb
│ ├── jenkins_git.rb
│ ├── crocagile.rb
│ ├── tddium.rb
│ ├── flowdock.rb
│ ├── pivotal_tracker.rb
│ ├── gemini.rb
│ ├── weblate.rb
│ ├── codeship.rb
│ ├── lingohub.rb
│ ├── freckle.rb
│ ├── pushbullet.rb
│ ├── gemnasium.rb
│ ├── sifter.rb
│ ├── prowl.rb
│ ├── icescrum.rb
│ ├── jaconda.rb
│ ├── leanpub.rb
│ ├── apiary.rb
│ ├── sprintly.rb
│ ├── skydeskprojects.rb
│ ├── clever_cloud.rb
│ ├── deploy_hq.rb
│ ├── phraseapp.rb
│ ├── copperegg.rb
│ ├── toggl.rb
│ ├── gitter.rb
│ ├── packagist.rb
│ ├── appharbor.rb
│ ├── statusnet.rb
│ ├── firebase.rb
│ ├── web.rb
│ ├── apropos.rb
│ ├── talker.rb
│ ├── deployervc.rb
│ ├── simperium.rb
│ └── pushover.rb
└── service
│ ├── events
│ ├── helpers
│ │ ├── helpers_with_actions.rb
│ │ └── helpers_with_meta.rb
│ ├── public_helpers.rb
│ ├── issue_helpers.rb
│ ├── commit_comment_helpers.rb
│ └── issue_comment_helpers.rb
│ └── structs.rb
├── .gitignore
├── test
├── mqtt_test.rb
├── acunote_test.rb
├── planbox_test.rb
├── grove_test.rb
├── piwik_plugins_test.rb
├── prowl_test.rb
├── read_the_docs_test.rb
├── get_localization_test.rb
├── habitualist_test.rb
├── lighthouse_test.rb
├── weblate_test.rb
├── conductor_test.rb
├── hostedgraphite.rb
├── web_translate_it_test.rb
├── djangopackages_test.rb
├── crocagile_test.rb
├── jira_test.rb
├── gemini_test.rb
├── rdocinfo_test.rb
├── statusnet_test.rb
├── planio_test.rb
├── trac_test.rb
├── kanbanery_test.rb
├── mantis_bt_test.rb
├── apropos_test.rb
├── pushover_test.rb
├── cia_test.rb
├── phraseapp_test.rb
├── toggl_test.rb
├── leanpub_test.rb
├── docker_test.rb
├── jaconda_test.rb
├── scrumdo_test.rb
├── skydeskprojects_test.rb
├── apiary_test.rb
├── zohoprojects_test.rb
├── divecloud_test.rb
├── sprintly_test.rb
├── codeship_test.rb
├── landscape_test.rb
├── flowdock_test.rb
├── huboard_test.rb
├── myget_test.rb
├── deployervc_test.rb
├── iron_mq_test.rb
├── lingohub_test.rb
├── jenkins_github_test.rb
├── unfuddle_test.rb
├── iron_worker_test.rb
├── simperium_test.rb
├── jenkins_git_test.rb
├── deploy_hq_test.rb
├── active_collab_test.rb
├── codeclimate_test.rb
├── commandoio_test.rb
├── sifter_test.rb
├── ontime_test.rb
├── windowsazure_test.rb
├── pushbullet_test.rb
├── bugherd_test.rb
└── zendesk_test.rb
├── README.md
└── LICENSE
/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.4.0
2 |
--------------------------------------------------------------------------------
/vendor/.require_paths:
--------------------------------------------------------------------------------
1 | lib
2 | ext/tmailscanner
3 | bin
4 |
--------------------------------------------------------------------------------
/docs/readthedocs:
--------------------------------------------------------------------------------
1 | Automatically build documentation hosted on readthedocs.org.
--------------------------------------------------------------------------------
/docs/djangopackages:
--------------------------------------------------------------------------------
1 | Automatically update commit history as tracked on djangopackages.com.
--------------------------------------------------------------------------------
/config/console.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../load", __FILE__)
2 | Service.load_services
3 |
--------------------------------------------------------------------------------
/config/email.yml:
--------------------------------------------------------------------------------
1 | ---
2 | address: smtp1.rs.github.com
3 | port: 25
4 | domain: github.com
5 |
--------------------------------------------------------------------------------
/docs/habitualist:
--------------------------------------------------------------------------------
1 | Automatically log commit activity against actions on https://habitualist.com
2 |
--------------------------------------------------------------------------------
/vendor/cache/i18n-0.9.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/i18n-0.9.1.gem
--------------------------------------------------------------------------------
/vendor/cache/json-1.8.6.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/json-1.8.6.gem
--------------------------------------------------------------------------------
/vendor/cache/jwt-2.1.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/jwt-2.1.0.gem
--------------------------------------------------------------------------------
/vendor/cache/mail-2.7.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/mail-2.7.0.gem
--------------------------------------------------------------------------------
/vendor/cache/mash-0.1.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/mash-0.1.1.gem
--------------------------------------------------------------------------------
/vendor/cache/mqtt-0.0.8.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/mqtt-0.0.8.gem
--------------------------------------------------------------------------------
/vendor/cache/unf-0.1.4.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/unf-0.1.4.gem
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Please contact GitHub support instead of creating an issue: https://github.com/contact
2 |
--------------------------------------------------------------------------------
/script/test:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Usage: script/test
3 | # Runs the library's test suite.
4 |
5 | bundle exec rake test
6 |
--------------------------------------------------------------------------------
/vendor/cache/builder-3.2.3.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/builder-3.2.3.gem
--------------------------------------------------------------------------------
/vendor/cache/faraday-0.9.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/faraday-0.9.0.gem
--------------------------------------------------------------------------------
/vendor/cache/hashie-2.1.2.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/hashie-2.1.2.gem
--------------------------------------------------------------------------------
/vendor/cache/maxcdn-0.3.2.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/maxcdn-0.3.2.gem
--------------------------------------------------------------------------------
/vendor/cache/netrc-0.11.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/netrc-0.11.0.gem
--------------------------------------------------------------------------------
/vendor/cache/oauth-0.4.4.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/oauth-0.4.4.gem
--------------------------------------------------------------------------------
/vendor/cache/rake-10.0.3.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/rake-10.0.3.gem
--------------------------------------------------------------------------------
/vendor/cache/signet-0.8.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/signet-0.8.1.gem
--------------------------------------------------------------------------------
/vendor/cache/tinder-1.10.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/tinder-1.10.0.gem
--------------------------------------------------------------------------------
/vendor/cache/tzinfo-1.2.4.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/tzinfo-1.2.4.gem
--------------------------------------------------------------------------------
/vendor/cache/xmlrpc-0.2.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/xmlrpc-0.2.1.gem
--------------------------------------------------------------------------------
/vendor/cache/xmpp4r-0.5.6.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/xmpp4r-0.5.6.gem
--------------------------------------------------------------------------------
/vendor/cache/aws-sdk-1.67.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/aws-sdk-1.67.0.gem
--------------------------------------------------------------------------------
/vendor/cache/jmespath-1.3.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/jmespath-1.3.1.gem
--------------------------------------------------------------------------------
/vendor/cache/mini_mime-1.0.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/mini_mime-1.0.0.gem
--------------------------------------------------------------------------------
/vendor/cache/minitest-5.10.3.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/minitest-5.10.3.gem
--------------------------------------------------------------------------------
/vendor/cache/nokogiri-1.8.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/nokogiri-1.8.1.gem
--------------------------------------------------------------------------------
/vendor/cache/ruby-hmac-0.4.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/ruby-hmac-0.4.0.gem
--------------------------------------------------------------------------------
/vendor/cache/unf_ext-0.0.7.4.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/unf_ext-0.0.7.4.gem
--------------------------------------------------------------------------------
/vendor/cache/yajl-ruby-1.3.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/yajl-ruby-1.3.1.gem
--------------------------------------------------------------------------------
/vendor/cache/activemodel-4.2.10.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/activemodel-4.2.10.gem
--------------------------------------------------------------------------------
/vendor/cache/addressable-2.5.2.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/addressable-2.5.2.gem
--------------------------------------------------------------------------------
/vendor/cache/aws-sdk-v1-1.67.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/aws-sdk-v1-1.67.0.gem
--------------------------------------------------------------------------------
/vendor/cache/eventmachine-1.2.5.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/eventmachine-1.2.5.gem
--------------------------------------------------------------------------------
/vendor/cache/http-cookie-1.0.3.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/http-cookie-1.0.3.gem
--------------------------------------------------------------------------------
/vendor/cache/mime-types-1.25.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/mime-types-1.25.1.gem
--------------------------------------------------------------------------------
/vendor/cache/multi_json-1.12.2.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/multi_json-1.12.2.gem
--------------------------------------------------------------------------------
/vendor/cache/rest-client-2.0.2.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/rest-client-2.0.2.gem
--------------------------------------------------------------------------------
/vendor/cache/simple_oauth-0.1.9.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/simple_oauth-0.1.9.gem
--------------------------------------------------------------------------------
/vendor/cache/thread_safe-0.3.6.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/thread_safe-0.3.6.gem
--------------------------------------------------------------------------------
/vendor/cache/twilio-ruby-3.9.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/twilio-ruby-3.9.0.gem
--------------------------------------------------------------------------------
/vendor/cache/xml-simple-1.0.11.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/xml-simple-1.0.11.gem
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 | rvm:
3 | - 2.4.0
4 | install: script/bootstrap
5 | script: bundle exec rake test
6 | sudo: false
7 |
--------------------------------------------------------------------------------
/vendor/cache/activeresource-4.0.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/activeresource-4.0.0.gem
--------------------------------------------------------------------------------
/vendor/cache/activesupport-4.2.10.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/activesupport-4.2.10.gem
--------------------------------------------------------------------------------
/vendor/cache/aws-sdk-core-2.0.48.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/aws-sdk-core-2.0.48.gem
--------------------------------------------------------------------------------
/vendor/cache/http_parser.rb-0.5.3.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/http_parser.rb-0.5.3.gem
--------------------------------------------------------------------------------
/vendor/cache/mini_portile2-2.3.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/mini_portile2-2.3.0.gem
--------------------------------------------------------------------------------
/vendor/cache/multipart-post-2.0.0.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/multipart-post-2.0.0.gem
--------------------------------------------------------------------------------
/vendor/cache/public_suffix-3.0.1.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/public_suffix-3.0.1.gem
--------------------------------------------------------------------------------
/docs/kanbanery:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. project token - Your project GitHub token from Kanbanery
5 | 2. project id
6 |
--------------------------------------------------------------------------------
/vendor/cache/concurrent-ruby-1.0.5.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/concurrent-ruby-1.0.5.gem
--------------------------------------------------------------------------------
/vendor/cache/rails-observers-0.1.5.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/rails-observers-0.1.5.gem
--------------------------------------------------------------------------------
/vendor/cache/twitter-stream-0.1.16.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/twitter-stream-0.1.16.gem
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gemspec
4 |
5 | gem "rake", "10.0.3"
6 | gem "minitest", :require => nil
7 |
--------------------------------------------------------------------------------
/vendor/cache/domain_name-0.5.20170404.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/domain_name-0.5.20170404.gem
--------------------------------------------------------------------------------
/vendor/cache/faraday_middleware-0.12.2.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/faraday_middleware-0.12.2.gem
--------------------------------------------------------------------------------
/vendor/cache/net-http-persistent-2.9.4.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/net-http-persistent-2.9.4.gem
--------------------------------------------------------------------------------
/vendor/cache/softlayer_messaging-1.0.2.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/github/github-services/HEAD/vendor/cache/softlayer_messaging-1.0.2.gem
--------------------------------------------------------------------------------
/config/secrets.yml.example:
--------------------------------------------------------------------------------
1 | # This is a placeholder for service secrets that gets written over on deploy.
2 | # THEY ARE SECRET, YOU CANNOT HAVE THEM
3 |
--------------------------------------------------------------------------------
/docs/statusnet:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. **Server** should be the server base URI.(eg. http://identi.ca or http://identi.ca/index.php)
--------------------------------------------------------------------------------
/script/console:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Usage: script/console
3 | # Starts an IRB console with this library loaded.
4 |
5 | exec bundle exec irb -r ./config/console
6 |
--------------------------------------------------------------------------------
/docs/harvest:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. Applies the status to the currently clocked in project. Future updates are expected to include more versatility.
5 |
--------------------------------------------------------------------------------
/script/package:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Usage: script/package
3 | # Updates the gemspec and builds a new gem in the pkg directory.
4 |
5 | mkdir -p pkg
6 | gem build *.gemspec
7 | mv *.gem pkg
8 |
--------------------------------------------------------------------------------
/lib/services/read_the_docs.rb:
--------------------------------------------------------------------------------
1 | class Service::ReadTheDocs < Service
2 | def receive_push
3 | http_post "https://readthedocs.org/github", :payload => generate_json(payload)
4 | end
5 | end
6 |
7 |
--------------------------------------------------------------------------------
/docs/rdocinfo:
--------------------------------------------------------------------------------
1 | This service allows you to auto-publish documentation for your Ruby gem or library.
2 | The resulting documentation will be hosted for you at http://rubydoc.info/github/your-name/your-project
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Please note: GitHub will only accept pull requests to existing services that implement bug fixes or security improvements. We no longer accept feature changes to existing services.
2 |
--------------------------------------------------------------------------------
/config/load.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'bundler/setup'
3 | $:.unshift *Dir["#{File.dirname(__FILE__)}/../vendor/internal-gems/**/lib"]
4 |
5 | require File.expand_path("../../lib/github-services", __FILE__)
6 |
--------------------------------------------------------------------------------
/lib/services/habitualist.rb:
--------------------------------------------------------------------------------
1 | class Service::Habitualist < Service
2 | def receive_push
3 | http_post "https://habitualist.com/webhooks/github/",
4 | :payload => generate_json(payload)
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/lib/service/events/helpers/helpers_with_actions.rb:
--------------------------------------------------------------------------------
1 | module Service::HelpersWithActions
2 | def action
3 | payload['action'].to_s
4 | end
5 |
6 | def opened?
7 | action == 'opened'
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/docs/apropos:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | Use the project identifier from your Apropos project. It will be right below the project name
5 | on the project page. It will look something like: GEZDGORQFY2TCNZRGY2TSMBVGUYDK
--------------------------------------------------------------------------------
/docs/bugherd:
--------------------------------------------------------------------------------
1 | BugHerd is the world's simplest bug tracker for the web. See: http://www.bugherd.com
2 |
3 | BugHerd allows you to visually track issues on your website. Using the GitHub integration you can update tasks directly from GitHub commit messages.
4 |
--------------------------------------------------------------------------------
/docs/planbox:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. The token is your Planbox Inititative Token. Find in on the Manage page.
5 | 2. More information available on Planbox's help site.
6 |
--------------------------------------------------------------------------------
/docs/toggl:
--------------------------------------------------------------------------------
1 | 1. API Key: Your toggl api key. (Get it at https://toggl.com/app/profile)
2 | 2. Project: the id of the toggl project that this repo links to
3 | 3. Activate and go!
4 | 4. To track your time simply add t:number-of-minutes (integer) to your commit message
5 |
--------------------------------------------------------------------------------
/docs/tender:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | If your URL is http://mysite.tenderapp.com, then:
5 |
6 | * Your **domain** is `mysite.tenderapp.com`
7 |
8 | * You can find your token in the tracker settings:
9 | http://mysite.tenderapp.com/settings/trackers
10 |
--------------------------------------------------------------------------------
/lib/services/web_translate_it.rb:
--------------------------------------------------------------------------------
1 | class Service::WebTranslateIt < Service
2 | string :api_key
3 |
4 | def receive_push
5 | http_post "https://webtranslateit.com/api/projects/#{data['api_key']}/refresh_files",
6 | :payload => generate_json(payload)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/docs/mantisbt:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | Requires the Source Integration plugins from http://leetcode.net/projects/source-integration/
5 |
6 | 1. Base URL to MantisBT install
7 | 2. Secret API Key set at http://yoursite/mantis/plugin.php?page=Source/manage_config_page
--------------------------------------------------------------------------------
/docs/jabber:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. **User** is the Jabber ID (e.g.: myusername@jabber.org). Multiple users can be added by separating them with commas. Currently, there is a maximum of 25 users. Add `github-services@jabber.org` to receive notifications.
5 |
6 |
--------------------------------------------------------------------------------
/script/cibuild:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Usage: script/test
3 | # Runs the library's CI suite.
4 |
5 | test -d "/usr/share/rbenv/shims" && {
6 | export PATH=/usr/share/rbenv/shims:$PATH
7 | export RBENV_VERSION="2.1.7-github"
8 | }
9 |
10 | script/bootstrap
11 | bundle exec rake test
12 |
--------------------------------------------------------------------------------
/script/update_github:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Usage: script/update_github
3 | # Updates the documentation for Services on GitHub.com
4 |
5 | # Expects github/github to be in the default Boxen location
6 | # https://github.com/github/github-services/blob/master/Rakefile#L56-L58
7 | bundle exec rake services:build
8 |
--------------------------------------------------------------------------------
/docs/getlocalization:
--------------------------------------------------------------------------------
1 | 1. Project name is your project name in Get Localization URL e.g:
2 |
3 | Given this URL:
4 |
5 | http://www.getlocalization.com/Example/
6 |
7 | Your project name is "Example"
8 |
9 | 2. Project token is available at your project settings if you've GitHub support enabled.
10 |
--------------------------------------------------------------------------------
/docs/grove:
--------------------------------------------------------------------------------
1 | This delivers updates to your GitHub repository to Grove.io's IRC channels.
2 | Events include Git pushes, issues, wiki changes, and comments.
3 |
4 | Install Notes
5 | -------------
6 |
7 | `channel_token` - Channel's unique token which can be found from channel settings (available for organization owners)
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 | deploy.rb
4 | *~
5 | *.sw[po]
6 | config/secrets.yml
7 | config/services.json
8 | /bin
9 | vendor/gems
10 | .bundle
11 | docs/payload_data
12 | .rvmrc
13 | .project
14 | .settings
15 | .buildpath
16 | log
17 | tmp
18 | pkg
19 | .iml
20 | Gemfile.lock
21 |
22 | github-services*.gem
23 |
--------------------------------------------------------------------------------
/docs/email:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. `address` whitespace separated email addresses (at most two)
5 | 2. `secret` fills out the Approved header to automatically approve the message
6 | in a read-only or moderated mailing list.
7 | 3. `send_from_author` uses the commit author email address in the From address of the email.
8 |
--------------------------------------------------------------------------------
/docs/piwikplugins:
--------------------------------------------------------------------------------
1 | [Piwik](http://piwik.org) is an open analytics platform which can be extended with Plugins and Themes. This service notifies the [Piwik Marketplace](http://plugins.piwik.org) of any new releases to your Piwik plugin. See [http://developer.piwik.org/guides/distributing-your-plugin](the Publisher Guide) for more information.
2 |
--------------------------------------------------------------------------------
/docs/trac:
--------------------------------------------------------------------------------
1 | This service is deprecated. To integrate GitHub with Trac, follow the
2 | instructions at: https://github.com/aaugustin/trac-github
3 |
4 | If you're currently relying on this service, please consider upgrading to
5 | trac-github. It uses a standard webhook to provide the same features and it's
6 | more actively maintained.
7 |
8 |
--------------------------------------------------------------------------------
/lib/services/acunote.rb:
--------------------------------------------------------------------------------
1 | class Service::Acunote < Service
2 | password :token
3 |
4 | def receive_push
5 | res = http_post "https://www.acunote.com/source_control/github/%s" %
6 | [ data['token'] ],
7 | {'payload' => generate_json(payload)}
8 |
9 | if res.status != 200
10 | raise_config_error
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/lib/services/snowyevening.rb:
--------------------------------------------------------------------------------
1 | class Service::SnowyEvening < Service
2 | string :project, :api_key
3 |
4 | def receive_push
5 | http.ssl[:verify] = false
6 | res = http_post "https://snowy-evening.com/api/integration/github_commit/"+data['api_key']+"/"+data['project'],
7 | :payload => generate_json(payload)
8 | return
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/docs/activecollab:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. Currently, you must specify in the configuration milestone and or category if you want the commits to be associated with them.
5 | In the future, I plan for this to have some form of configuration via tags / branches, or something like that.
6 | 2. URL, Project ID, and Token are required the others not so much.
7 |
--------------------------------------------------------------------------------
/docs/conductor:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 | 1. **API Key** is from within the Conductor project. (https://conductor-app.com/)
4 | 2. This service will post back all pushes, regardless of whether or not they contain ticket annotations.
5 | 3. Annotations will be parsed for [#xxx] content, where xxx denotes a valid ticket number in the relevant Conductor project
6 |
--------------------------------------------------------------------------------
/docs/webtranslateit:
--------------------------------------------------------------------------------
1 | This service notify Web Translate It of pushes to your public repository. Web Translate It will then refresh the language file(s) if they have been updated.
2 |
3 | More info: http://docs.webtranslateit.com/github-integration/
4 |
5 | Install Notes
6 | -------------
7 |
8 | * **API Key** is your project API key (you can find it in the project settings)
9 |
--------------------------------------------------------------------------------
/docs/gemnasium:
--------------------------------------------------------------------------------
1 | Gemnasium notifies you when new versions are released for your GitHub repositories' gem dependencies.
2 |
3 | ----
4 |
5 | 1. Enter your GitHub name
6 | 2. Create an account on [gemnasium.com](http://gemnasium.com/)
7 | 3. Enter your API key (from [gemnasium.com/account](http://gemnasium.com/account))
8 | 4. Check "Active"
9 | 5. Click "Update Settings"
10 |
11 |
--------------------------------------------------------------------------------
/docs/snowyevening:
--------------------------------------------------------------------------------
1 | Notifies your project account on Snowy-Evening.com of commits.
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. Login or create a free or paid account with Snowy-Evening.com
7 | 2. Create a project and visit the Project Edit page
8 | 3. Find the GitHub integration box, which contains the API Key and Project ID
9 | 4. Copy those credentials into these fields.
10 |
11 |
--------------------------------------------------------------------------------
/docs/talker:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. **Url** should be your room url, for example https://youraccount.talkerapp.com/rooms/ROOM_ID
5 | 2. **Token** should be on your settings page
6 | 3. If **Digest** is checked, all commits will be compressed in one message
7 |
8 | Note: replace https with http on the url if you're on the Free plan as it doesn't include enhanced security (SSL).
--------------------------------------------------------------------------------
/lib/services/hostedgraphite.rb:
--------------------------------------------------------------------------------
1 | class Service::Hostedgraphite < Service
2 | string :api_key
3 |
4 | def receive_push
5 | res = http_post "https://www.hostedgraphite.com/integrations/github/",
6 | 'payload' => generate_json(payload),
7 | 'api_key' => data['api_key']
8 |
9 | if res.status != 200
10 | raise_config_error
11 | end
12 |
13 | end
14 | end
15 |
16 |
--------------------------------------------------------------------------------
/docs/basecamp:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. project_url is the URL of your Basecamp project: https://basecamp.com/1234/projects/5678
5 | 2. email_address is the email you sign in to Basecamp with. This person must have access to the project. To add events on behalf of other people, make the person an admin on the project.
6 | 3. password is the password you sign in to Basecamp with.
7 |
--------------------------------------------------------------------------------
/lib/services/rdocinfo.rb:
--------------------------------------------------------------------------------
1 | class Service::RDocInfo < Service::HttpPost
2 |
3 | default_events :push
4 |
5 | title 'RubyDoc.info'
6 | url 'http://www.rubydoc.info'
7 |
8 | maintained_by :github => 'zapnap'
9 |
10 | supported_by :web => 'http://www.rubydoc.info', :github => 'zapnap'
11 |
12 | def receive_event
13 | deliver 'http://www.rubydoc.info/checkout'
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/lib/services/planio.rb:
--------------------------------------------------------------------------------
1 | class Service::Planio < Service
2 | string :address, :project, :api_key
3 | white_list :address, :project
4 |
5 | def receive_push
6 | http.ssl[:verify] = true
7 | http.url_prefix = data['address']
8 | http_get "sys/fetch_changesets" do |req|
9 | req.params['key'] = data['api_key']
10 | req.params['id'] = data['project']
11 | end
12 | end
13 | end
14 |
15 |
--------------------------------------------------------------------------------
/script/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Usage: script/bootstrap
3 | # Ensures all gems are in vendor/cache and installed locally.
4 | set -e
5 |
6 | if [ "$(uname -s)" = "Darwin" ]; then
7 | HOMEBREW_PREFIX="$(brew --prefix)"
8 | bundle config --local build.eventmachine "--with-cppflags=-I$HOMEBREW_PREFIX/opt/openssl/include"
9 | fi
10 |
11 | bundle install --binstubs --local --path=vendor/gems
12 | bundle package --all
13 |
--------------------------------------------------------------------------------
/docs/jaconda:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | Pushes all Hooks for this Repository to Jaconda (Pushes, Issues, Pull Requests, etc).
5 |
6 | Using the following url as an example:
7 | https://bigbang.jaconda.im/rooms/galaxo
8 |
9 | 1. Subdomain is bigbang
10 | 2. Room ID is galaxo
11 | 3. Room token can be found on the Room Integration page
12 | 4. if Digest is checked, all commits will be compressed in one message
13 |
--------------------------------------------------------------------------------
/lib/services/trac.rb:
--------------------------------------------------------------------------------
1 | class Service::Trac < Service
2 | string :url
3 | password :token
4 | white_list :url
5 |
6 | def receive_push
7 | http.ssl[:verify] = false
8 | http.url_prefix = data['url']
9 | http_post "github/#{data['token']}", :payload => generate_json(payload)
10 | rescue Faraday::Error::ConnectionFailed
11 | raise_config_error "Connection refused. Invalid server URL."
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/docs/pivotaltracker:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. "token" is your Pivotal Tracker API Token. This is at the bottom of your 'My Profile' page.
5 | 2. "branch" is a space-separated list of the branches you want to listen for commits on. If none is provided it will listen on all branches.
6 | 3. "endpoint" is an optional endpoint for a custom Pivotal Tracker installation. Leave this blank to use "https://www.pivotaltracker.com".
7 |
--------------------------------------------------------------------------------
/docs/typetalk:
--------------------------------------------------------------------------------
1 | Posts a message to [Typetalk](https://typetalk.in) topics when you push to GitHub.
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. Need to [register new application](https://typetalk.in/my/develop/applications) that authorises GitHub to access to the Typetalk API. (Grant type must be "Client Credentials")
7 | 2. Enter your credentials.
8 | - client_id
9 | - client_secret
10 | 3. Enter topic id to post messages.
11 |
--------------------------------------------------------------------------------
/lib/services/bugherd.rb:
--------------------------------------------------------------------------------
1 | class Service::BugHerd < Service
2 | default_events :issues, :issue_comment, :push
3 | string :project_key
4 | white_list :project_key
5 |
6 | def receive_push
7 | url = "http://www.bugherd.com/github_web_hook/#{data['project_key']}"
8 | http_post url, :payload => generate_json(payload)
9 | end
10 |
11 | alias receive_issues receive_push
12 | alias receive_issue_comment receive_push
13 | end
14 |
--------------------------------------------------------------------------------
/docs/deployervc:
--------------------------------------------------------------------------------
1 | This service hook triggers a deployment on deployer.vc whenever a push is made.
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. **Deployment Address** - URL of the deployment to be triggered whenever a commit/push occurs, normally in the format `https://.deployer.vc/#/deployment/`
7 | 2. **API Token** - An API token for your deployer.vc account, which can be created under `https://.deployer.vc/#/account`
--------------------------------------------------------------------------------
/lib/services/planbox.rb:
--------------------------------------------------------------------------------
1 | class Service::Planbox < Service
2 | password :token
3 |
4 | def receive_push
5 | token = data['token']
6 | res = http_post 'https://work.planbox.com/api/github_commits' do |req|
7 | req.params[:token] = data['token']
8 | req.body = {:payload => generate_json(payload)}
9 | end
10 |
11 | if res.status < 200 || res.status > 299
12 | raise_config_error
13 | end
14 | end
15 | end
16 |
17 |
--------------------------------------------------------------------------------
/docs/weblate:
--------------------------------------------------------------------------------
1 | This service will notify Weblate about pushes to your repository.
2 | Weblate will then refresh updated translations and merge them with your
3 | changes.
4 |
5 | More info: http://weblate.org/
6 |
7 | Install Notes
8 | -------------
9 |
10 | You need to have enabled hooks in your Weblate installation (this is default)
11 | see documentation for more information:
12 | https://weblate.readthedocs.org/en/latest/api.html#notification-hooks
13 |
--------------------------------------------------------------------------------
/lib/services/grove.rb:
--------------------------------------------------------------------------------
1 | class Service::Grove < Service
2 | default_events :commit_comment, :gollum, :issues, :issue_comment, :pull_request, :push
3 | password :channel_token
4 |
5 | def receive_push
6 | token = data['channel_token'].to_s
7 | raise_config_error "Missing channel token" if token.empty?
8 |
9 | res = http_post "https://grove.io/api/services/github/#{token}",
10 | :payload => generate_json(payload)
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/lib/services/http_post.rb:
--------------------------------------------------------------------------------
1 | class Service::HttpPost < Service
2 | include HttpHelper
3 |
4 | alias receive_event deliver
5 |
6 | def receive_event
7 | deliver data['url'], :content_type => data['content_type'],
8 | :insecure_ssl => data['insecure_ssl'].to_i == 1, :secret => data['secret']
9 | end
10 |
11 | def original_body
12 | {:payload => payload, :event => event.to_s, :config => data,
13 | :guid => delivery_guid}
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/docs/lingohub:
--------------------------------------------------------------------------------
1 | Start localizing your software to increase market share and improve customer satisfaction.
2 | Localization is simple with lingohub. Be Global, Go Local!
3 |
4 | Install Notes
5 | -------------
6 |
7 | 1. Please enter your Project Token found in your project settings page.
8 | 2. Now edit your 'Watch Patterns on the 'Imports/Edit your repository settings' page. Only files that contain translations for your master locale should be included in the given regular expression.
9 |
--------------------------------------------------------------------------------
/lib/services/codereviewhub.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../web', __FILE__)
2 |
3 | class Service::Codereviewhub < Service::Web
4 | self.title = "CodeReviewHub"
5 | url "https://www.codereviewhub.com"
6 | logo_url "https://www.codereviewhub.com/favicon.ico"
7 |
8 | supported_by :email => 'contact@codereviewhub.com'
9 | maintained_by :github => 'codereviewhub'
10 | default_events :pull_request, :issue_comment, :commit_comment, :pull_request_review_comment
11 | end
12 |
--------------------------------------------------------------------------------
/docs/ironworker:
--------------------------------------------------------------------------------
1 | Posts all of your GitHub events to IronWorker so you can write IronWorker scripts for testing and deploying applications.
2 |
3 | For more information about IronWorker, see [www.iron.io](http://www.iron.io).
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. **token** - Your Iron.io OAuth token. Get yours at: http://hud.iron.io/tokens
9 | 2. **project_id** - The Iron.io project ID you you'd like to use.
10 | 3. **code_name** - The name of the worker code to post to.
11 |
--------------------------------------------------------------------------------
/docs/gemini:
--------------------------------------------------------------------------------
1 | IT'S ABOUT TRACKING
2 | Gemini is the all-in-one Tracker that works beautifully for any kind of project, team or process.
3 | Every task, initiative, bug, issue, enquiry, change request and ticket in one place.
4 |
5 | This GitHub integration works with Gemini v5.1.2+.
6 |
7 | Install Notes
8 | -------------
9 |
10 | * Create an API Key(GUID) in your Web.config file for the key "gemini.apikey".
11 | * "gemini_url" is YOUR Gemini instance i.e "http://gemini.countersoft.com".
12 |
--------------------------------------------------------------------------------
/lib/services/piwik_plugins.rb:
--------------------------------------------------------------------------------
1 | class Service::PiwikPlugins < Service::HttpPost
2 |
3 | self.title = 'Piwik Plugins'
4 |
5 | url "http://plugins.piwik.org/"
6 |
7 | logo_url "http://piwik.org/wp-content/themes/piwik/img/logo_mainpage.png"
8 |
9 | maintained_by :github => 'halfdan', :twitter => 'geekproject'
10 |
11 | supported_by :email => 'fabian@piwik.org'
12 |
13 | def receive_push
14 | deliver "http://plugins.piwik.org/postreceive-hook"
15 | end
16 |
17 | end
18 |
--------------------------------------------------------------------------------
/docs/acunote:
--------------------------------------------------------------------------------
1 | Acunote is an online project management and Scrum software. Integrating it with
2 | GitHub lets you see commits in the Timeline, perform code review on commits and
3 | create code inspection tasks. See http://www.acunote.com/ for more information.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. Token - GitHub Service Hook Token for your Acunote organization. Get it
9 | from "Edit Organization" > "Repositories" page in Acunote.
10 | 2. Don't forget to check "Active"
11 |
12 |
--------------------------------------------------------------------------------
/docs/jenkins:
--------------------------------------------------------------------------------
1 | [Jenkins](http://jenkins-ci.org/) is a popular continuous integration server.
2 |
3 | Using the Jenkins GitHub Plugin you can automatically trigger build jobs when
4 | pushes are made to GitHub.
5 |
6 | Install Notes
7 | -------------
8 |
9 | 1. "Jenkins Hook Url" is the URL of your Jenkins server's webhook endpoint. For
10 | example: `http://ci.jenkins-ci.org/github-webhook/`.
11 |
12 | For more information see .
13 |
--------------------------------------------------------------------------------
/lib/services/zohoprojects.rb:
--------------------------------------------------------------------------------
1 | class Service::ZohoProjects < Service
2 | string :project_id
3 | password :token
4 | white_list :project_id
5 |
6 | def receive_push
7 | res = http_post "https://projects.zoho.com/serviceHook",
8 | :pId => data['project_id'],
9 | :authtoken => data['token'],
10 | :scope => "projectsapi",
11 | :payload => generate_json(payload)
12 | if res.status != 200
13 | raise_config_error
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/docs/leanpub:
--------------------------------------------------------------------------------
1 | This service starts a preview of your book on Leanpub whenever a push is made to your repository.
2 |
3 | Required values are:
4 |
5 | api_key: Your Leanpub api_key, which you can find at https://leanpub.com/author_dashboard/settings.
6 |
7 | slug: The slug for your book. This is the part of the URL for your book after https://leanpub.com/. For example, for https://leanpub.com/lean, the slug is lean.
8 |
9 | See https://leanpub.com/help/api for more information on the Leanpub API.
10 |
--------------------------------------------------------------------------------
/lib/services/kanbanery.rb:
--------------------------------------------------------------------------------
1 | class Service::Kanbanery < Service
2 | string :project_id
3 | password :project_token
4 | white_list :project_id
5 |
6 | def receive_push
7 | project_id = data['project_id']
8 | token = data['project_token']
9 |
10 | http_post "https://kanbanery.com/api/v1/projects/#{project_id}/git_commits",
11 | generate_json(payload),
12 | 'X-Kanbanery-ProjectGitHubToken' => token,
13 | 'Content-Type' => 'application/json'
14 | end
15 | end
16 |
17 |
--------------------------------------------------------------------------------
/docs/huboard:
--------------------------------------------------------------------------------
1 | Instant project management for you GitHub repositories
2 |
3 | See: https://huboard.com
4 |
5 | HuBoard is built from the ground up using the GitHub public API. HuBoard issues **are** GitHub issues, you will never
6 | have to deal with synchronization problems. Keep you issues where they belong, in the repository with you code.
7 |
8 | By enabling GitHub's Service Hook integration, HuBoard keeps your agile boards up to date by sending events that occur
9 | on GitHub directly to HuBoard.
10 |
--------------------------------------------------------------------------------
/lib/service/events/public_helpers.rb:
--------------------------------------------------------------------------------
1 | module Service::PublicHelpers
2 | include Service::HelpersWithMeta
3 |
4 | def summary_url
5 | payload['repository']['url']
6 | end
7 |
8 | def summary_message
9 | "[%s] %s made the repository public" % [
10 | repo.name,
11 | sender.login,
12 | ]
13 | rescue
14 | raise_config_error "Unable to build message: #{$!.to_s}"
15 | end
16 |
17 | def self.sample_payload
18 | Service::HelpersWithMeta.sample_payload
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/docs/deployhq:
--------------------------------------------------------------------------------
1 | DeployHQ is a service which lets you deploy directly
2 | from your GitHub repository to your server via FTP or
3 | SSH/SFTP.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. **Deploy Hook URL** Should be the automatic deployment URL of the
9 | server you wish to deploy to. You can find this on the
10 | Edit Server or Edit Server Group page in DeployHQ.
11 |
12 | 1. **Email Pusher** Specifies whether the person who pushed
13 | the commits should receive an email once a deployment
14 | is completed.
15 |
--------------------------------------------------------------------------------
/docs/hostedgraphite:
--------------------------------------------------------------------------------
1 | Hosted Graphite is a time-series database for application and performance monitoring.
2 | Integrating it with GitHub gives you a realtime view of the commits happening on your codebase.
3 | See http://www.hostedgraphite.com/ for more information.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. API Key - Add your API key from your Hosted Graphite account page, located at https://www.hostedgraphite.com/accounts/profile/
9 | 2. Bingo! GitHub will send details of each commit to your Hosted Graphite account.
10 |
11 |
--------------------------------------------------------------------------------
/docs/ironmq:
--------------------------------------------------------------------------------
1 | Posts all of your GitHub events to IronMQ so you can process the events asynchronously. This can also be used as a safe
2 | buffer between GitHub and your application so you never miss a GitHub event.
3 |
4 | For more information about IronMQ, see [www.iron.io](http://www.iron.io).
5 |
6 | Install Notes
7 | -------------
8 |
9 | 1. **token** - Your Iron.io OAuth token. Get yours at: http://hud.iron.io/tokens
10 | 2. **project_id** - The Iron.io project ID you you'd like to use.
11 | 3. **queue_name** - The name of the queue to post to.
12 |
--------------------------------------------------------------------------------
/docs/travis:
--------------------------------------------------------------------------------
1 | Travis CI is a distributed continuous integration service.
2 |
3 | By enabling this hook, Travis CI will listen to push and pull request events to trigger new builds.
4 |
5 | For more details about Travis, go to http://docs.travis-ci.com.
6 |
7 | ## Automatic configuration from Travis CI
8 | We recommend using the Travis profile page at https://travis-ci.org/profile to manage your hooks.
9 | For private repositories, use https://travis-ci.com/profile.
10 |
11 | ## Travis CI Status
12 | Travis CI status page: http://status.travis-ci.com
13 |
--------------------------------------------------------------------------------
/lib/services/landscape.rb:
--------------------------------------------------------------------------------
1 | class Service::Landscape < Service::HttpPost
2 | default_events Service::ALL_EVENTS
3 |
4 | url "https://landscape.io"
5 | logo_url "https://landscape-io.s3.amazonaws.com/img/landscape_logo.png"
6 |
7 | maintained_by :github => 'landscapeio'
8 |
9 | supported_by :web => 'https://landscape.io/contact',
10 | :email => 'help@landscape.io',
11 | :twitter => 'landscapeio',
12 | :github => 'landscapeio'
13 |
14 | def receive_event
15 | deliver 'https://landscape.io/hooks/github'
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/lib/service/events/helpers/helpers_with_meta.rb:
--------------------------------------------------------------------------------
1 | module Service::HelpersWithMeta
2 | def repo
3 | @repo ||= self.class.objectify(payload['repository'])
4 | end
5 |
6 | def sender
7 | @sender ||= self.class.objectify(payload['sender'])
8 | end
9 |
10 | def self.sample_payload
11 | {
12 | "repository" => {
13 | "name" => "grit",
14 | "url" => "http://github.com/mojombo/grit",
15 | "owner" => { "login" => "mojombo" }
16 | },
17 | "sender" => { "login" => 'defunkt' }
18 | }
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/docs/prowl:
--------------------------------------------------------------------------------
1 | Prowl is an iPhone App+Web Service for arbitrary Push Notifications. After installing the app and registering the device, you receive an API key and can send notifications from your computer via Growl (with the Prowl GrowlStyle installed) or from any server with very little work (at least as far as the Push submission is concerned).
2 |
3 | To get started, create a user account for Prowl at https://www.prowlapp.com/.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. Create a new API key for GitHub at the [Prowl website](https://www.prowlapp.com/api_settings.php).
9 |
--------------------------------------------------------------------------------
/docs/softlayermessaging:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 |
5 | "SoftLayer Message Queue" getting started guide:
6 | http://sldn.softlayer.com/article/Message-Queue-Getting-Started
7 |
8 | 1. account is the publishing account, typically 5 characters and not the username
9 | 2. user is the authenticating portal user
10 | 3. key is the messaging API key (not SoftLayer API key).
11 | 4. name is the queue or topic name. This will need to be created before hand.
12 | 5. topic designates whether the name provided is either a topic or a queue name.
13 |
--------------------------------------------------------------------------------
/test/mqtt_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class MqttPubTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | skip "Temporarily disabled as the q.m2m.io host is returning 503 errors"
10 | svc = service :push, {'broker' => 'q.m2m.io','port' => '1883', 'id' => 'github', 'topic' => 'github/franklovecchio/github-services'}, 'payload'
11 | svc.receive
12 | end
13 |
14 | def service(*args)
15 | super Service::MqttPub, *args
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/docs/copperegg:
--------------------------------------------------------------------------------
1 | Allows you to setup a GitHub repository to create Annotations on git pushes.
2 | Annotations are created like so:
3 |
4 | "GitHub: #{payload['pusher']['name']} has pushed
5 | #{payload['commits'].size} commit(s) to
6 | #{payload['repository']['name']}"
7 |
8 | Install Notes
9 | -------------
10 | 1. **API Key** - Your API key. See: Settings tab, Personal Settings: https://app.copperegg.com/
11 | 2. **Tag** - Tag to automatically apply to each created Annotation.
12 | 3. **Master Only** - Only create Annotations for pushes to the master branch.
13 |
--------------------------------------------------------------------------------
/lib/services/get_localization.rb:
--------------------------------------------------------------------------------
1 | class Service::GetLocalization < Service
2 | string :project_name
3 | password :project_token
4 | white_list :project_name
5 |
6 | def receive_push
7 | project_name = data['project_name']
8 | project_token = data['project_token']
9 |
10 | res = http_post "https://www.getlocalization.com/services/github/notify/#{project_name}/#{project_token}/",
11 | :payload => generate_json(payload)
12 |
13 | if res.status < 200 || res.status > 299
14 | raise_config_error
15 | end
16 | end
17 | end
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/acunote_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class AcunoteTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | url = "/source_control/github/abc"
10 | @stubs.post url do |env|
11 | assert_equal "payload=%22payload%22", env[:body]
12 | [200, {}, '']
13 | end
14 |
15 | svc = service :push, {'token' => 'abc'}, 'payload'
16 | svc.receive
17 | end
18 |
19 | def service(*args)
20 | super Service::Acunote, *args
21 | end
22 | end
23 |
24 |
--------------------------------------------------------------------------------
/docs/backlog:
--------------------------------------------------------------------------------
1 | Backlog is a project management, hosting service.
2 | http://backlogtool.com, http://www.backlog.jp (Japanese)
3 |
4 | Install Notes
5 | -------------
6 |
7 | 1. **api_url** is a API URL. e.g. if the Space ID is example, then the api_url will be https://example.backlog.jp/XML-RPC or https://example.backlogtoo.com/XML-RPC
8 |
9 | 2. **user_id** and **password** - user_id and password of a Backlog user that can post comment and update issue.
10 |
11 | You can specify issue keys (e.g. DORA-1) and status keywords (#fixed, #closed) to change issue status (Resolved, Closed).
12 |
--------------------------------------------------------------------------------
/docs/pushover:
--------------------------------------------------------------------------------
1 | Pushover is a cross-platform push notification service with a [simple API](https://pushover.net/api).
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. Install the [iOS client](https://pushover.net/clients) from the App Store, or the [Android client](https://pushover.net/clients) from the Android Market.
7 |
8 | 2. Login to [Pushover](https://pushover.net/) and copy your user key.
9 |
10 | 3. Add your user key in the field above. Optionally enter a device name to have notifications go to a single device, or leave blank to send to all active devices on your account.
11 |
12 |
--------------------------------------------------------------------------------
/docs/windowsazure:
--------------------------------------------------------------------------------
1 | This service posts a payload for GitHub 'push' event to a Windows Azure WebSites (WAWS).
2 | This enables continuous integration and deployment with WAWS.
3 |
4 | More Info: http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-git/
5 |
6 | Supported events are currently: 'push'
7 |
8 | Config:
9 | 'hostname' - The Azure WebSites SCM endpoint hostname.
10 | 'username' - Username basic cred for SCM endpoint.
11 | 'password' - Password basic cred for SCM endpoint.
12 |
13 | Data:
14 | 'payload' - Standard GitHub event payload by event type.
15 |
--------------------------------------------------------------------------------
/docs/firebase:
--------------------------------------------------------------------------------
1 | This service hook adds an object to a given Firebase for every commit.
2 |
3 | The commit will be appended, in-order, to the URL provided in the 'firebase'
4 | configuration option. This is the equivalent of calling:
5 |
6 | new Firebase(firebase).push(commit);
7 |
8 | from the JS library.
9 |
10 | The provided URL must point to a valid Firebase reference, and must be prefixed
11 | with https://
12 |
13 | If you have secured your Firebase with security rules that prevent anonymous
14 | writes, you may provide the secret to your firebase in the configuration
15 | options.
16 |
--------------------------------------------------------------------------------
/docs/landscape:
--------------------------------------------------------------------------------
1 | Landscape is a continuous code quality inspector for Python projects.
2 |
3 | By enabling this hook, Landscape will listen for pushes and on each push, instigate a new code check.
4 |
5 | Install Notes
6 | -------------
7 |
8 | Landscape will automatically install this hook, there is no need to do it manually.
9 |
10 | To install:
11 |
12 | 1. Create an account at https://landscape.io (you can sign in with GitHub)
13 | 2. Enable checking on a repository. The hook will be automatically installed.
14 |
15 | For more information about Landscape, see https://docs.landscape.io/
16 |
--------------------------------------------------------------------------------
/test/planbox_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class PlanboxTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/api/github_commits" do |env|
10 | assert_equal 'work.planbox.com', env[:url].host
11 | assert_match 'payload=%7B%22a%22%3A1%7D', env[:body]
12 | [200, {}, '']
13 | end
14 |
15 | svc = service({}, :a => 1)
16 | svc.receive_push
17 | end
18 |
19 | def service(*args)
20 | super Service::Planbox, *args
21 | end
22 | end
23 |
24 |
--------------------------------------------------------------------------------
/docs/phraseapp:
--------------------------------------------------------------------------------
1 | *Your companion to become a global player. The translation management software for websites and mobile apps.*
2 |
3 | This service lets you connect your GitHub repository to an existing [PhraseApp](https://phraseapp.com) translation project to automatically push new translations from your locale files into PhraseApp.
4 |
5 | Read more: [Documentation](https://phraseapp.com/docs)
6 |
7 | Install Notes
8 | -------------
9 |
10 | Just add your project **auth token** to the hook configuration. You find your token on your project overview page after creating the first project in PhraseApp.
11 |
--------------------------------------------------------------------------------
/docs/sprintly:
--------------------------------------------------------------------------------
1 | Sprint.ly is a project management aide which is lightweight for developers and provides visibility for external stakeholders.
2 |
3 | Integration with sprint.ly powers closing tickets through commit messages, updating ticket status via pull request and much more.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. Sign up at https://sprint.ly/
9 | 2. On your profile page ( https://sprint.ly/account/profile/ ), get your API key.
10 | 3. On your product's page, get the product number. The id is in the URL like: https://sprint.ly/product/3722/ -- 3722 would be your product id.
11 | 4. Enjoy!
12 |
--------------------------------------------------------------------------------
/lib/services/conductor.rb:
--------------------------------------------------------------------------------
1 | class Service::Conductor < Service
2 | string :api_key
3 | white_list :api_key
4 |
5 | default_events :push
6 |
7 | url "https://conductor-app.com"
8 | logo_url "#{url}/logo-blue.png"
9 |
10 | maintained_by :github => 'Shuntyard'
11 | supported_by :email => 'support@conductor-app.com'
12 |
13 | def receive_push
14 | api_key = data['api_key']
15 |
16 | http.ssl[:verify] = false
17 | http.headers['X-GitHub-Event'] = event.to_s
18 | http_post "#{self.class.url}/github/commit/#{api_key}", :payload => generate_json(payload)
19 | end
20 |
21 | end
22 |
--------------------------------------------------------------------------------
/lib/services/djangopackages.rb:
--------------------------------------------------------------------------------
1 | class Service::DjangoPackages < Service::HttpPost
2 |
3 | default_events :push
4 |
5 | url "https://www.djangopackages.com/"
6 | logo_url "https://s3.amazonaws.com/opencomparison/img/logo_squares.png"
7 |
8 | maintained_by :github => 'pydanny',
9 | :twitter => '@pydanny'
10 |
11 | supported_by :email => 'pydanny@gmail.com',
12 | :twitter => '@pydanny'
13 |
14 | # ssl_version 2
15 |
16 | def receive_push
17 | url = "https://www.djangopackages.com/packages/github-webhook/"
18 | http_post url, :payload => generate_json(payload)
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/lib/services/myget.rb:
--------------------------------------------------------------------------------
1 | class Service::MyGet < Service::HttpPost
2 | string :hook_url
3 |
4 | white_list :hook_url
5 |
6 | url "https://www.myget.org"
7 | logo_url "https://www.myget.org/Content/images/myget/myget_125x25.png"
8 |
9 | default_events :push
10 |
11 | maintained_by :github => 'myget',
12 | :twitter => '@MyGetTeam'
13 |
14 | supported_by :web => 'https://www.myget.org/support',
15 | :email => 'support@myget.org',
16 | :twitter => '@MyGetTeam'
17 |
18 | def receive_event
19 | url = required_config_value('hook_url')
20 |
21 | deliver url
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/docs/cia:
--------------------------------------------------------------------------------
1 | 1. Disable multiple messages if more than 5 commits are pushed. Instead announce the last commit with "(+## more commits...)" appended to the note.
2 | 2. `address` is the optional CIA address, defaults to http://cia.vc
3 | 3. `project` is the optional project name, defaults to the Repository name.
4 | 4. `branch` lets you specify the branch name, or a template with `%s` to fill the branch name in.
5 | 5. `long_urls` enables full URLs instead of shortened URLs.
6 | 6. `module` sets the module name in the project.
7 | 7. `full_commits` enables sending full commit messages to CIA (as opposed to just the first line).
8 |
9 |
--------------------------------------------------------------------------------
/docs/codereviewhub:
--------------------------------------------------------------------------------
1 | [CodeReviewHub](https://www.codereviewhub.com) will add these hooks automatically to projects which you enable on www.codereviewhub.com
2 |
3 | GitHub Code Reviews made easy
4 | -----------------------------
5 |
6 | - Keep track of unaddressed comments.
7 | - Keep track of open issues.
8 | - No more lost file comments due to changing diffs!
9 |
10 | Install Notes
11 | -------------
12 |
13 | 1. Sign up at https://www.codereviewhub.com with your GitHub account
14 | 2. Add your repository
15 | 3. You're ready!
16 |
17 | For more details about CodeReviewHub, go to https://www.codereviewhub.com.
18 |
--------------------------------------------------------------------------------
/lib/services/scrumdo.rb:
--------------------------------------------------------------------------------
1 | class Service::ScrumDo < Service
2 | string :username, :project_slug
3 | password :password
4 | white_list :project_slug, :username
5 |
6 | def receive_push
7 | username = data["username"]
8 | password = data["password"]
9 |
10 | url = "http://www.scrumdo.com/hooks/github/#{data["project_slug"]}"
11 | res = http_post url do |req|
12 | req.body = {:payload => generate_json(payload), :username=>username, :password=>password}
13 | end
14 |
15 | if res.status < 200 || res.status > 299
16 | raise_config_error
17 | end
18 | end
19 | end
20 |
21 |
--------------------------------------------------------------------------------
/test/grove_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class GroveTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | @channel_token = "test_token"
7 | end
8 |
9 | def test_push
10 | @stubs.post "/api/services/github/#{@channel_token}" do |env|
11 | assert_equal 'grove.io', env[:url].host
12 | [200, {}, '']
13 | end
14 |
15 | svc = service(
16 | {'channel_token' => 'test_token'}, payload)
17 | svc.receive_push
18 | end
19 |
20 | def service(*args)
21 | super Service::Grove, *args
22 | end
23 | end
24 |
25 |
--------------------------------------------------------------------------------
/docs/lighthouse:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | Using the following url as an example:
5 | http://logicalawesome.lighthouseapp.com/projects/8570-github/overview
6 |
7 | 1. **Subdomain** is logicalawesome
8 | 2. **Project Id** is 8570
9 | 3. This service only supports project tokens
10 | (accepting patches for user-based tokens)
11 | 4. **Private** determines whether changed files
12 | should be displayed (useful for public LH
13 | accounts and private GH repos)
14 | 5. **Send Only Ticket Commits** ensures that the only commits sent to
15 | Lighthouse are ones with Lighthouse ticket codes.
16 |
--------------------------------------------------------------------------------
/test/piwik_plugins_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class PiwikPluginsTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | svc = service({}, 'a' => 1)
8 |
9 | @stubs.post "/postreceive-hook" do |env|
10 | body = JSON.parse(env[:body])
11 | assert_equal 'plugins.piwik.org', env[:url].host
12 | assert_equal 1, body['payload']['a']
13 | [200, {}, '']
14 | end
15 |
16 | svc.receive_push
17 |
18 | @stubs.verify_stubbed_calls
19 | end
20 |
21 | def service_class
22 | Service::PiwikPlugins
23 | end
24 | end
25 |
26 |
--------------------------------------------------------------------------------
/lib/services/docker.rb:
--------------------------------------------------------------------------------
1 | class Service::Docker < Service::HttpPost
2 |
3 | url "http://www.docker.com"
4 | logo_url "http://www.docker.com/static/img/nav/docker-logo-loggedout.png"
5 |
6 | # kencochrane on GitHub/twitter is pinged for any bugs with the Hook code.
7 | maintained_by :github => 'kencochrane',
8 | :twitter => '@kencochrane'
9 |
10 | # Support channels for user-level Hook problems (service failure,
11 | # misconfigured
12 | supported_by :github => 'kencochrane',
13 | :twitter => '@docker'
14 |
15 | def receive_event
16 | deliver "https://registry.hub.docker.com/hooks/github"
17 | end
18 | end
19 |
20 |
--------------------------------------------------------------------------------
/lib/services/jenkins_github.rb:
--------------------------------------------------------------------------------
1 | class Service::JenkinsGitHub < Service
2 | self.title = 'Jenkins (GitHub plugin)'
3 | self.hook_name = 'jenkins' # legacy hook name
4 |
5 | string :jenkins_hook_url
6 | white_list :jenkins_hook_url
7 |
8 | def receive_push
9 | if data['jenkins_hook_url'].present?
10 | url = data['jenkins_hook_url']
11 | else
12 | raise_config_error "Jenkins Hook Url not set"
13 | end
14 | http.ssl[:verify] = false # :(
15 | http.url_prefix = url
16 | http.headers['X-GitHub-Event'] = "push"
17 | http_post url,
18 | :payload => generate_json(payload)
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/test/prowl_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class ProwlTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/publicapi/add" do |env|
10 | assert_equal 'api.prowlapp.com', env[:url].host
11 | data = Faraday::Utils.parse_query(env[:body])
12 | assert_equal 'a', data['apikey']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service({'apikey' => 'a'}, payload)
17 | svc.receive_push
18 | end
19 |
20 | def service(*args)
21 | super Service::Prowl, *args
22 | end
23 | end
24 |
25 |
--------------------------------------------------------------------------------
/lib/services/mantis_bt.rb:
--------------------------------------------------------------------------------
1 | class Service::MantisBT < Service
2 | string :url, :api_key
3 | white_list :url
4 |
5 | def receive_push
6 | http.ssl[:verify] = false
7 | http.url_prefix = data['url']
8 | res = http_post 'plugin.php', :payload => generate_json(payload) do |req|
9 | req.params.update \
10 | :page => "Source/checkin",
11 | :api_key => data['api_key']
12 | end
13 |
14 | if res.status < 200 || res.status > 299
15 | raise_config_error
16 | end
17 | rescue Faraday::Error::ConnectionFailed
18 | raise_config_error "Connection refused. Invalid server URL."
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/lib/services/huboard.rb:
--------------------------------------------------------------------------------
1 | class Service::HuBoard < Service::HttpPost
2 |
3 | default_events :issue_comment, :issues
4 |
5 | url "https://huboard.com"
6 | logo_url "https://huboard.com/img/LogoFullPurpleLight.png"
7 | maintained_by :github => 'rauhryan'
8 | supported_by :email => 'support@huboard.com'
9 |
10 | HUBOARD_URL = "https://huboard.com/api/site"
11 |
12 | def receive_issues
13 | http_post "#{HUBOARD_URL}/webhook/issue", :payload => generate_json(payload)
14 | end
15 |
16 | def receive_issue_comment
17 | http_post "#{HUBOARD_URL}/webhook/comment", :payload => generate_json(payload)
18 | end
19 |
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/test/read_the_docs_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class ReadTheDocsTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/github" do |env|
10 | assert_equal 'readthedocs.org', env[:url].host
11 | data = Faraday::Utils.parse_query(env[:body])
12 | assert_equal 1, JSON.parse(data['payload'])['a']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service({}, :a => 1)
17 | svc.receive_push
18 | end
19 |
20 | def service(*args)
21 | super Service::ReadTheDocs, *args
22 | end
23 | end
24 |
25 |
--------------------------------------------------------------------------------
/docs/campfire:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. subdomain is your campfire subdomain
5 | (ie 'your-subdomain' if you visit 'https://your-subdomain.campfirenow.com')
6 |
7 | 2. room is the actual room name, not the id
8 |
9 | 3. token is your API token. get it from campfire's "Edit my Campfire
10 | account" screen
11 |
12 | 4. master_only is a boolean flag indicating whether only commits to master
13 | should be announced
14 |
15 | 5. play_sound is a boolean flag indicating whether a sound should be played
16 |
17 | 6. sound is the sound that should be played if play_sound is
18 | true. defaults to 'rimshot'
19 |
--------------------------------------------------------------------------------
/lib/services/codeclimate.rb:
--------------------------------------------------------------------------------
1 | class Service::CodeClimate < Service::HttpPost
2 | password :token
3 |
4 | default_events :push, :pull_request
5 |
6 | url "http://codeclimate.com"
7 |
8 | maintained_by :github => "mrb"
9 |
10 | supported_by :web => "https://codeclimate.com/contact",
11 | :email => "hello@codeclimate.com",
12 | :twitter => "@codeclimate"
13 |
14 | def receive_event
15 | token = required_config_value('token')
16 | http.basic_auth "github", token
17 | deliver "https://codeclimate.com/github_events", insecure_ssl: true
18 | end
19 |
20 | def token
21 | data["token"].to_s.strip
22 | end
23 |
24 | end
25 |
--------------------------------------------------------------------------------
/test/get_localization_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class GetLocalizationTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | svc = service({
10 | 'project_name' => 'n',
11 | 'project_token' => 't'}, 'a' => 1)
12 |
13 | @stubs.post "/services/github/notify/n/t/" do |env|
14 | assert_match /payload=%7B%22a%22%3A1%7D($|\&)/, env[:body]
15 | [200, {}, '']
16 | end
17 |
18 | svc.receive_push
19 | end
20 |
21 | def service(*args)
22 | super Service::GetLocalization, *args
23 | end
24 | end
25 |
26 |
--------------------------------------------------------------------------------
/test/habitualist_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class HabitualistTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/webhooks/github/" do |env|
10 | assert_equal 'habitualist.com', env[:url].host
11 | data = Faraday::Utils.parse_query(env[:body])
12 | assert_equal 1, JSON.parse(data['payload'])['a']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service({}, :a => 1)
17 | svc.receive_push
18 | end
19 |
20 | def service(*args)
21 | super Service::Habitualist, *args
22 | end
23 | end
24 |
25 |
--------------------------------------------------------------------------------
/docs/unfuddle:
--------------------------------------------------------------------------------
1 | Unfuddle is a lovely ticket management, time tracking, project hosting service.
2 |
3 | Install Notes
4 | ---------------
5 |
6 | Create a new Git repository in your Unfuddle project.
7 | Once created, edit the repository settings. Check the
8 | "Changesets Managed Manually" checkbox.
9 |
10 | Make note of the following from the URL:
11 |
12 | http://example.unfuddle.com/a#/projects/32429/repositories/28573/browse
13 |
14 | In the above, the data you need for configuration is:
15 |
16 | * subdomain: example
17 | * repo_id: 28573
18 |
19 | If your URL begins with http:// rather than https:// check the Httponly box when setting up the service hook.
20 |
--------------------------------------------------------------------------------
/docs/irker:
--------------------------------------------------------------------------------
1 | 1. `address` is the irker service address.
2 | 2. `channels` is the channel or list of channels the commit notification should be posted to. Format is irc://chat.freenode.net/#commits. Multiple urls should be semicolon (;) separated.
3 | 3. `project` is the optional project name, defaults to the Repository name.
4 | 4. `branch` lets you specify the branch name, or a template with `%s` to fill the branch name in.
5 | 5. `long_urls` enables full URLs instead of shortened URLs.
6 | 6. `module` sets the module name in the project.
7 | 7. `color` adds mIRC color codes to the message.
8 | 8. `full_commits` sends multiple messages to show up to 5 lines of the commit message.
9 |
10 |
--------------------------------------------------------------------------------
/docs/packagist:
--------------------------------------------------------------------------------
1 | Packagist – the main Composer repository
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. Create an account on packagist.org
7 | 2. Enter your credentials
8 | - The token which you can find on the Packagist profile page
9 |
10 | Optional steps:
11 | - Enter the username (**not** email) who the API token belongs to (defaults to the repository owner)
12 | - Enter the host of your Packagist installation (defaults to https://packagist.org), the protocol-prefix is optional and defaults to "http://".
13 |
14 | 3. Check the "Active" checkbox and click "Update Service".
15 |
16 | For more details about Packagist, visit https://packagist.org/
17 |
--------------------------------------------------------------------------------
/lib/services/jenkins_git.rb:
--------------------------------------------------------------------------------
1 | class Service::JenkinsGit < Service
2 | self.title = 'Jenkins (Git plugin)'
3 |
4 | NOTIFY_URL = '%s/git/notifyCommit'
5 |
6 | string :jenkins_url
7 | white_list :jenkins_url
8 |
9 | def receive_push
10 | if !data['jenkins_url'].present?
11 | raise_config_error "Jenkins URL not set"
12 | end
13 |
14 | url = NOTIFY_URL % data['jenkins_url'].sub(%r{/+$}, '')
15 |
16 | params = {
17 | :url => repo_url,
18 | :from => 'github'
19 | }
20 |
21 | params[:branches] = branch_name unless tag?
22 |
23 | http.ssl[:verify] = false
24 | http.url_prefix = url
25 | http_get url, params
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/test/lighthouse_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class LighthouseTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/projects/1/changesets.xml" do |env|
10 | assert_equal 'application/xml', env[:request_headers]['Content-Type']
11 | assert_equal 's.lighthouseapp.com', env[:url].host
12 | [200, {}, '']
13 | end
14 |
15 | svc = service(
16 | {'subdomain' => 's', 'project_id' => '1'}, payload)
17 | svc.receive_push
18 | end
19 |
20 | def service(*args)
21 | super Service::Lighthouse, *args
22 | end
23 | end
24 |
25 |
--------------------------------------------------------------------------------
/test/weblate_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class WeblateTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/hooks/github/" do |env|
10 | assert_equal 'weblate.example.org', env[:url].host
11 | assert_equal 'application/x-www-form-urlencoded',
12 | env[:request_headers]['content-type']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service :push,
17 | {'url' => 'weblate.example.org'}, payload
18 | svc.receive_push
19 | end
20 |
21 | def service(*args)
22 | super Service::Weblate, *args
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/test/conductor_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class ConductorTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | url = "/github/commit/abc123def456"
10 | @stubs.post url do |env|
11 | body = Faraday::Utils.parse_query(env[:body])
12 | payload = JSON.parse(body['payload'])
13 | assert_equal payload['ref'], 'refs/heads/master'
14 | [200, {}, '']
15 | end
16 |
17 | svc = service({'api_key' => 'abc123def456'}, payload)
18 | svc.receive_push
19 | end
20 |
21 | def service(*args)
22 | super Service::Conductor, *args
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/test/hostedgraphite.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class HostedGraphiteTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | url = "/integrations/github/"
10 | @stubs.post url do |env|
11 | params = Faraday::Utils.parse_query env[:body]
12 | assert_equal 'payload', JSON.parse(params['payload'])
13 | assert_equal 'test', params['api_key']
14 | [200, {}, '']
15 | end
16 |
17 | svc = service :push, {'api_key' => 'test'}, 'payload'
18 | svc.receive
19 | end
20 |
21 | def service(*args)
22 | super Service::Hostedgraphite, *args
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/docs/divecloud:
--------------------------------------------------------------------------------
1 | DiveCloud integrates Application Performance Testing into the Continuous Integration Cycle by allowing you to run a performance test after each successful deployment.
2 |
3 | When GitHub receives notice that you have successfully deployed your application, it will initiate a performance test based on the test plan you created at https://divecloud.nouvola.com.
4 |
5 | Please enter your API Key and the Plan ID for the plan that you would like to run on successful deployment of your application.
6 |
7 | If you would like to add 'Think Time' to you test, select the 'Think Time' checkbox.
8 |
9 | If your test plan includes credentials, include your credential password in the field below.
10 |
--------------------------------------------------------------------------------
/docs/zohoprojects:
--------------------------------------------------------------------------------
1 | Project ID and Token is required for configuration which will be available under "Dashboard" --> "Project Settings" --> "Service Hooks".
2 |
3 | This service hook allows you to associate changeset(s) with bug(s) in Zoho Projects. To associate changeset(s) with bug(s) in ZohoProjects you will need to give the BUG ID in in your commit message.
4 |
5 | Syntax: `OPEN SQUARE BRACKET #BUGID CLOSE SQUARE BRACKET` followed by commit message
6 |
7 | Ex: `[#SDP-23] fixed the memory leak issue.`
8 |
9 | This will associate the changeset with bug with ID SDP-23.
10 |
11 | For more than one bugs, provide the BUG IDS separated by comma.
12 |
13 | Ex: `[#SDP-24,#SDP-25] UI alignment fix done.`
14 |
--------------------------------------------------------------------------------
/test/web_translate_it_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class WebTranslateItTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/api/projects/a/refresh_files" do |env|
10 | assert_equal 'webtranslateit.com', env[:url].host
11 | data = Faraday::Utils.parse_nested_query(env[:body])
12 | assert_equal 1, JSON.parse(data['payload'])['a']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service({'api_key' => 'a'}, :a => 1)
17 | svc.receive_push
18 | end
19 |
20 | def service(*args)
21 | super Service::WebTranslateIt, *args
22 | end
23 | end
24 |
25 |
--------------------------------------------------------------------------------
/test/djangopackages_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class DjangoPackagesTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/packages/github-webhook/" do |env|
10 | assert_equal 'www.djangopackages.com', env[:url].host
11 | data = Faraday::Utils.parse_query(env[:body])
12 | assert_equal 1, JSON.parse(data['payload'])['a']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service({"zen" => "test", "hook_id" => "123" }, :a => 1)
17 | svc.receive_push
18 | end
19 |
20 | def service(*args)
21 | super Service::DjangoPackages, *args
22 | end
23 | end
24 |
25 |
--------------------------------------------------------------------------------
/docs/scrumdo:
--------------------------------------------------------------------------------
1 | ScrumDo is an agile/scrum project management site found at http://www.scrumdo.com
2 | Integrating GitHub with ScrumDo lets you see commits in your project newsfeed, and allows you to update stories via commit messages.
3 |
4 | To update a story, type Story #(num) Status as part of your commit message. Examples:
5 |
6 | * Story #13 Done
7 | * Story #5 Doing
8 | * Story #3 Reviewing
9 |
10 | Install Notes
11 | -------------
12 |
13 | 1. Username and Password are your ScrumDo.com credentials.
14 | 2. The project slug can be found in the URL of your project.
15 |
16 | Given this URL:
17 |
18 | http://www.scrumdo.com/projects/project/acme-project/
19 |
20 | Your project slug is `acme-project`
21 |
22 |
--------------------------------------------------------------------------------
/docs/gitter:
--------------------------------------------------------------------------------
1 | Chat rooms for your public and private repos with awesome GitHub integration.
2 |
3 | https://gitter.im
4 |
5 | If you want to see detailed repo activity in your room, follow this steps:
6 |
7 | - Click the **Settings Cog** on the top right
8 | - Click on **Integrations**
9 | - Select **GitHub**
10 | - Click on **configure manually** option
11 | - Copy and paste the provided token here
12 |
13 | Install Notes
14 | -------------
15 |
16 | 1. **Token** - Gitter token for this repo
17 |
18 | Options
19 |
20 | 2. **Mute Fork** - Mute fork notifications.
21 | 3. **Mute Watch** - Mute watch notifications.
22 | 4. **Mute Comments** - Mute issue and pull request comments.
23 | 5. **Mute Wiki** - Mute wiki changes.
24 |
--------------------------------------------------------------------------------
/lib/services/crocagile.rb:
--------------------------------------------------------------------------------
1 | class Service::Crocagile < Service::HttpPost
2 | string :project_key
3 | url "https://www.crocagile.com/home"
4 | logo_url "https://www.crocagile.com/_images/crocagile100x100t.png"
5 | maintained_by :github => 'noelbaron',
6 | :twitter => 'noelbaron'
7 | supported_by :web => 'https://www.crocagile.com/home',
8 | :email => 'support@crocagile.com',
9 | :twitter => 'crocagilehelp'
10 |
11 | def receive_event
12 | raise_config_error "Please enter your Project Key (located via Project Settings screen)." if data['project_key'].to_s.empty?
13 | http.headers['Content-Type'] = 'application/json'
14 | deliver "https://www.crocagile.com/api/integration/github"
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/test/crocagile_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class CrocagileTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "api/integration/github" do |env|
10 | assert_equal 'www.crocagile.com', env[:url].host
11 | assert_equal 'application/json', env[:request_headers]['content-type']
12 | [200, {}, '{"status":1,"message":"GitHub Webook processed successfully."}']
13 | end
14 | svc = service({'project_key'=>'foo'},payload)
15 | svc.receive_event
16 | @stubs.verify_stubbed_calls
17 | end
18 |
19 | def service(*args)
20 | super Service::Crocagile, *args
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/test/jira_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class JIRATest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/a/rest/api/a/issue/1/transitions" do |env|
10 | assert_equal 'application/json', env[:request_headers]['Content-Type']
11 | assert_equal 'foo.com', env[:url].host
12 | [200, {}, '']
13 | end
14 |
15 | svc = service(
16 | {'server_url' => 'http://foo.com/a', 'username' => 'u', 'password' => 'p',
17 | 'api_version' => 'a'},
18 | payload)
19 | svc.receive_push
20 | end
21 |
22 | def service(*args)
23 | super Service::JIRA, *args
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/test/gemini_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class GeminiTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/gemini/api/github/commit" do |env|
10 | assert_equal 'localhost', env[:url].host
11 | assert_equal 'application/json', env[:request_headers]['content-type']
12 | [200, {}, '']
13 | end
14 |
15 | config = {'server_url' => 'http://localhost/gemini',
16 | 'api_key' => '43904539-01DD-48DF-98F3-C887DE833C3H'}
17 |
18 | svc = service(config, payload)
19 | svc.receive_push
20 | end
21 |
22 | def service(*args)
23 | super Service::Gemini, *args
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/test/rdocinfo_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class RDocInfoTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | @stubs.post "/checkout" do |env|
8 | assert_equal 'www.rubydoc.info', env[:url].host
9 | body = JSON.parse(env[:body])
10 | assert_equal 'push', body['event']
11 | assert_equal 'test', body['payload']['repository']['id']
12 | [200, {}, '']
13 | end
14 |
15 | payload = { 'repository' => { 'id' => 'test' }}
16 | svc = service({}, payload)
17 | svc.receive_event
18 | @stubs.verify_stubbed_calls
19 | end
20 |
21 | private
22 |
23 | def service_class
24 | Service::RDocInfo
25 | end
26 | end
27 |
28 |
--------------------------------------------------------------------------------
/docs/apiary:
--------------------------------------------------------------------------------
1 | [Apiary.io](http://apiary.io/) is a REST API documentation, mocking and testing service. This service hook auto-updates your hosted API documentation generated from [API Blueprint](http://apiary.io/blueprint) in your repository. See more at [http://apiary.io/](http://apiary.io/)
2 |
3 | Install Notes
4 | -------------
5 |
6 | Apiary needs your OAuth token in order to download your `apiary.apib` (that describes your API) file from your repository. Set up this service by:
7 |
8 | 1. Go to [Apiary Settings](http://apiary.io/settings)
9 | 2. Click the **Connect to GitHub** button
10 | 3. _(optional)_ After completing the steps above you can always edit `Branch` field right here. Commits to this GitHub branch will trigger an update at Apiary
11 |
--------------------------------------------------------------------------------
/test/statusnet_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class StatusNetTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/api/statuses/update.xml" do |env|
10 | assert_equal 's.com', env[:url].host
11 | data = Faraday::Utils.parse_nested_query(env[:body])
12 | assert_equal 'github', data['source']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service({'server' => 'http://s.com'}, payload)
17 |
18 | def svc.shorten_url(*args)
19 | 'short'
20 | end
21 |
22 | svc.receive_push
23 | end
24 |
25 | def service(*args)
26 | super Service::StatusNet, *args
27 | end
28 | end
29 |
30 |
--------------------------------------------------------------------------------
/test/planio_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class PlanioTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.get "/a/sys/fetch_changesets" do |env|
10 | assert_equal 'r.com', env[:url].host
11 | data = Faraday::Utils.parse_nested_query(env[:body])
12 | assert_equal 'a', env[:params]['key']
13 | assert_equal 'p', env[:params]['id']
14 | [200, {}, '']
15 | end
16 |
17 | svc = service({'address' => 'http://r.com/a/',
18 | 'api_key' => 'a', 'project' => 'p'}, :a => 1)
19 | svc.receive_push
20 | end
21 |
22 | def service(*args)
23 | super Service::Planio, *args
24 | end
25 | end
26 |
27 |
--------------------------------------------------------------------------------
/docs/freckle:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | Using the following URL as an example: https://nutsnbolts.letsfreckle.com
5 |
6 | 1. Account name: subdomain of the freckle account (nutsnbolts)
7 | 2. Token: the API token for an individual freckle user who is associated with the target freckle account (see instructions below)
8 | 3. Project name: the exact name of the target freckle project to log time for this repo
9 |
10 | To get your API token: log into your freckle account, click Settings at the top right, then click the Integration (API) tab.
11 |
12 | Note about email addresses: the email address on a committer's GitHub account should match his/her email address on his/her freckle account. Otherwise, we can't identify the person who is logging time.
--------------------------------------------------------------------------------
/docs/sifter:
--------------------------------------------------------------------------------
1 | Sifter is a simple issue tracker designed explicitly for teams with non-technical team members. (https://sifterapp.com)
2 |
3 | The integration enables you to comment on, resolve, and close issues via commit messages.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 0. Sign up for Sifter (https://sifterapp.com)
9 | 1. Create a new project.
10 | 2. Go to your Sifter project
11 | 3. Go to the "Project Settings" > "Integrations" page.
12 | 4. Copy the token on the page for GitHub and add it here along with your account's subdomain.
13 | 5. Any team members that want to use the integration will need to visit their profile page and explicitly link their Sifter user account with their GitHub user account so that we can identify individuals from their commits.
--------------------------------------------------------------------------------
/lib/services/tddium.rb:
--------------------------------------------------------------------------------
1 | class Service::Tddium < Service::HttpPost
2 | password :token
3 | string :override_url
4 |
5 | white_list :override_url
6 |
7 | url "https://www.tddium.com"
8 | logo_url "https://www.tddium.com/favicon.ico"
9 |
10 | maintained_by :github => 'solanolabs', :twitter => '@solanolabs'
11 | supported_by :web => 'https://support.tddium.com/', :email => 'support@tddium.com'
12 |
13 | default_events Service::ALL_EVENTS
14 |
15 | def receive_event
16 | token = required_config_value('token')
17 | override_url = data['override_url']
18 |
19 | url_base = override_url.present? ? override_url : "https://hooks.tddium.com:443/1/github"
20 | tddium_url = "#{url_base}/#{token}"
21 | deliver tddium_url
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/test/trac_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class TracTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/s/github/t" do |env|
10 | assert_equal 's.trac.com', env[:url].host
11 | assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
12 | data = Faraday::Utils.parse_nested_query(env[:body])
13 | assert_equal 1, JSON.parse(data['payload'])['a']
14 | [200, {}, '']
15 | end
16 |
17 | svc = service({'url' => 'http://u:p@s.trac.com/s', 'token' => 't'}, :a => 1)
18 | svc.receive_push
19 | end
20 |
21 | def service(*args)
22 | super Service::Trac, *args
23 | end
24 | end
25 |
26 |
--------------------------------------------------------------------------------
/test/kanbanery_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class KanbaneryTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | url = '/api/v1/projects/123/git_commits'
10 | @stubs.post url do |env|
11 | assert_equal %({"a":1}), env[:body]
12 | assert_equal 'a1b2c3', env[:request_headers]['X-Kanbanery-ProjectGitHubToken']
13 | assert_equal 'application/json', env[:request_headers]['Content-Type']
14 | [200, {}, '']
15 | end
16 |
17 | svc = service({'project_id' => '123', 'project_token' => 'a1b2c3'}, 'a' => 1)
18 | svc.receive_push
19 | end
20 |
21 | def service(*args)
22 | super Service::Kanbanery, *args
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/docs/appharbor:
--------------------------------------------------------------------------------
1 | AppHarbor is a .NET Platform as a Service. Use this service to automatically trigger build, test run and deployment of your AppHarbor application when you push to GitHub.
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. Go to your application's main page on AppHarbor and find the "Create build URL". Example: https://appharbor.com/application/{application_slug}/build?authorization={token}
7 | 2. "token" is the value of the "authorization" parameter.
8 | 3. "application_slug" is a list of unique application identifiers delimited by "," (i.e. "foo" or "foo,bar") that pushes should trigger builds on.
9 | 4. If your GitHub repository is private you need to add the "apphb" GitHub user as a collaborator. This enables AppHarbor to download the source code.
10 |
11 |
--------------------------------------------------------------------------------
/docs/fisheye:
--------------------------------------------------------------------------------
1 | Atlassian FishEye is a revision-control browser and search engine.
2 | The GitHub FishEye service can be used to trigger repository scan after code has been pushed to your git repository.
3 |
4 | Requires FishEye 2.10 or later.
5 |
6 | Install Notes
7 | -------------
8 |
9 | 1. Your FishEye server must be accessible from the internet
10 |
11 | 2. "url_base" is the URL to your FishEye server
12 | Example: http://fisheye.example.com/ or http://fisheye.example.com/fisheye/
13 |
14 | 3. "token" is the REST API token for your FishEye server
15 | It is defined in FishEye Administration > Security Settings > Authentication > REST API Token
16 |
17 | 4. "repository_name" is the repository name (optional)
18 | If not set GitHub repository name is used
19 |
--------------------------------------------------------------------------------
/test/mantis_bt_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class MantisBTTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/abc/plugin.php" do |env|
10 | assert_equal 'abc.com', env[:url].host
11 | assert_equal 'Source/checkin', env[:params]['page']
12 | assert_equal 'key', env[:params]['api_key']
13 | assert_match 'payload=%7B%22a%22%3A1%7D', env[:body]
14 | [200, {}, '']
15 | end
16 |
17 | svc = service(
18 | {'url' => 'http://abc.com/abc/', 'api_key' => 'key'},
19 | :a => 1)
20 | svc.receive_push
21 | end
22 |
23 | def service(*args)
24 | super Service::MantisBT, *args
25 | end
26 | end
27 |
28 |
--------------------------------------------------------------------------------
/test/apropos_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class WebTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/api/v1/githook/abcdefg01234" do |env|
10 | assert_equal 'application/json', env[:request_headers]['Content-Type']
11 | assert_equal 'www.apropos.io', env[:url].host
12 | assert_equal payload, JSON.parse(env[:body])
13 | [200, {}, '{"message":"OK"}']
14 | end
15 |
16 | svc = service({
17 | 'project_id' => 'abcdefg01234',
18 | 'content_type' => 'json'
19 | }, payload)
20 | svc.receive_push
21 | end
22 |
23 | def service(*args)
24 | super Service::Apropos, *args
25 | end
26 |
27 | end
28 |
--------------------------------------------------------------------------------
/test/pushover_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class PushoverTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | svc = service({"user_key" => "a", "device_name" => "hi"}, payload)
10 |
11 | def svc.shorten_url(*args)
12 | "short"
13 | end
14 |
15 | @stubs.post "/1/messages.json" do |env|
16 | assert_equal "api.pushover.net", env[:url].host
17 | data = Faraday::Utils.parse_query(env[:body])
18 | assert_equal "a", data["user"]
19 | assert_equal "hi", data["device"]
20 | [200, {}, '']
21 | end
22 |
23 | svc.receive_push
24 | end
25 |
26 | def service(*args)
27 | super Service::Pushover, *args
28 | end
29 | end
30 |
31 |
--------------------------------------------------------------------------------
/test/cia_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class CIATest < Service::TestCase
4 | def setup
5 | @messages = []
6 | @server = lambda do |method, message|
7 | @messages << [method, message]
8 | end
9 | end
10 |
11 | def test_push
12 | svc = service({'project' => 'abc', 'long_url'=>1}, payload)
13 | svc.xmlrpc_server = @server
14 | svc.receive_push
15 |
16 | assert msg = @messages.shift
17 | assert_equal 'hub.deliver', msg.first
18 | assert_match '06f63b43050935962f84fe54473a7c5de7977325', msg.last
19 | assert msg = @messages.shift
20 | assert msg = @messages.shift
21 | assert_nil @messages.shift
22 | end
23 |
24 | def service(*args)
25 | super Service::CIA, *args
26 | end
27 | end
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/test/phraseapp_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class PhraseappTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | test_auth_token = "footoken"
8 |
9 | data = {
10 | "auth_token" => test_auth_token
11 | }
12 |
13 | payload = {'commits'=>[{'id'=>'test'}]}
14 | svc = service(data, payload)
15 |
16 | @stubs.post "/api/v1/hooks/github" do |env|
17 | body = JSON.parse(env[:body])
18 |
19 | assert_equal("phraseapp.com", env[:url].host)
20 | assert_equal("post", env[:method].to_s)
21 | [200, {}, '']
22 | end
23 |
24 | svc.receive_push
25 | @stubs.verify_stubbed_calls
26 | end
27 |
28 | def service_class
29 | Service::Phraseapp
30 | end
31 | end
32 |
33 |
--------------------------------------------------------------------------------
/docs/smartling:
--------------------------------------------------------------------------------
1 | The [Smartling](http://www.smartling.com/) platform simplifies and accelerates translation and localization of your websites, mobile apps, and documents.
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. **Service url** - URL where your _Repository Connector service_ is run
7 | 2. **Project ID** - Your Smartling Project identifier code. You can find it and your **API key** in [Smartling dashboard -> Project Settings -> API](https://dashboard.smartling.com/settings/api.htm)
8 | 3. **API key** - Your Smartling API key
9 | 4. **Config path** - Relative path to the Smartling configuration file in your repository. By default the file name is expected to be `smartling-config.json`
10 | 5. **Master only** - If this flag is checked only changes to the `master` branch will be uploaded to Smartling
11 |
--------------------------------------------------------------------------------
/docs/sqsqueue:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | The Amazon SQS service allows GitHub to send a notification to an Amazon SQS queue.
5 |
6 | 1. Configure your Amazon AWS account with an appropriately set up access-key/secret-key (Either parent account or IAM)
7 | that has permissions to perform 'SendMessage' operations. (https://console.aws.amazon.com/sqs/)
8 |
9 | 2. Amazon SQS ARN is the unique code SQS references your queue with. It can be copied from the console
10 | or fetched through the API. It takes the form of arn:aws:sqs:us-(region)-(dc):(id):(name). Copy and
11 | paste the entire string. This hook parses the necessary details from the arn.
12 | You may also specify a SQS Queue URL instead of an ARN if you want to use IAM or a Queue that was created using a different account.
13 |
--------------------------------------------------------------------------------
/lib/services/flowdock.rb:
--------------------------------------------------------------------------------
1 | require 'uri'
2 |
3 | class Service::Flowdock < Service::HttpPost
4 | default_events :commit_comment, :gollum, :issues, :issue_comment, :pull_request, :push, :pull_request_review_comment
5 | password :token
6 |
7 | url "https://www.flowdock.com"
8 | logo_url "https://d2ph5hv9wbwvla.cloudfront.net/github/icon_220x140.png"
9 | maintained_by email: "team@flowdock.com", github: 'Mumakil'
10 | supported_by email: "support@flowdock.com", twitter: "@flowdock"
11 |
12 | def receive_event
13 | raw_token = required_config_value('token')
14 | token = URI.escape(raw_token.to_s.gsub(/\s/, ''))
15 | http.headers['X-GitHub-Event'] = event.to_s
16 | deliver "https://api.flowdock.com/v1/github/#{token}"
17 | end
18 |
19 | def original_body
20 | payload
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/test/toggl_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class TogglTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | url = "/api/v8/time_entries"
10 | @stubs.post url do |env|
11 | assert_equal 'www.toggl.com', env[:url].host
12 | assert_equal basic_auth(:a, :api_token), env[:request_headers]['authorization']
13 | assert_equal 900, JSON.parse(env[:body])['time_entry']['duration']
14 | [200, {}, '']
15 | end
16 |
17 | modified = payload.dup
18 | modified['commits'].first['message'].sub! /f:/, 't:'
19 | svc = service({'api_token' => 'a'}, modified)
20 | svc.receive_push
21 | end
22 |
23 | def service(*args)
24 | super Service::Toggl, *args
25 | end
26 | end
27 |
28 |
--------------------------------------------------------------------------------
/docs/twilio:
--------------------------------------------------------------------------------
1 | Allows you to setup a GitHub repository to send out SMS messages on git pushes.
2 | Currently the SMS message is built to say:
3 |
4 | "#{payload['pusher']['name']} has pushed #{payload['commits'].size} commit(s) to #{payload['repository']['name']}"
5 |
6 | Install Notes
7 | -------------
8 |
9 | 1. Signup for a Twilio account at http://www.twilio.com/try-twilio?home-page
10 | 2. You can find your account_sid and auth_token on your account page at https://www.twilio.com/user/account
11 | 3. from_phone must be a "Twilio phone number enabled for SMS. Only phone numbers or short codes purchased from Twilio work here"
12 | 4. to_phone is the "destination phone number. Format with a '+' and country code e.g., +16175551212 (E.164 format)."
13 | 5. Check master_only if you only want to receive updates for master.
14 |
15 |
--------------------------------------------------------------------------------
/test/leanpub_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class LeanpubTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | test_api_key = "123abc"
8 | test_slug = "myamazingbook"
9 |
10 | data = {
11 | 'api_key' => test_api_key,
12 | 'slug' => test_slug
13 | }
14 |
15 | payload = {}
16 | svc = service(data, payload)
17 |
18 | @stubs.post "/#{test_slug}/preview?api_key=#{test_api_key}" do |env|
19 | body = JSON.parse(env[:body])
20 |
21 | assert_equal env[:url].host, "leanpub.com"
22 | assert_equal 'push', body['event']
23 | [200, {}, '']
24 | end
25 |
26 | svc.receive_event
27 | @stubs.verify_stubbed_calls
28 | end
29 |
30 | def service_class
31 | Service::Leanpub
32 | end
33 | end
34 |
--------------------------------------------------------------------------------
/lib/services/pivotal_tracker.rb:
--------------------------------------------------------------------------------
1 | class Service::PivotalTracker < Service
2 | password :token
3 | string :branch, :endpoint
4 | white_list :endpoint, :branch
5 |
6 | def receive_push
7 | token = data['token']
8 | branches = data['branch'].to_s.split(/\s+/)
9 | ref = payload["ref"].to_s
10 |
11 | notify if branches.empty? || branches.include?(ref.split("/").last)
12 | end
13 |
14 | def notify
15 | endpoint = data['endpoint'].to_s
16 | endpoint = 'https://www.pivotaltracker.com/services/v3/github_commits' if endpoint.empty?
17 | res = http_post endpoint do |req|
18 | req.params[:token] = data['token']
19 | req.body = {:payload => generate_json(payload)}
20 | end
21 |
22 | if res.status < 200 || res.status > 299
23 | raise_config_error
24 | end
25 | end
26 | end
27 |
28 |
--------------------------------------------------------------------------------
/docs/pushbullet:
--------------------------------------------------------------------------------
1 | [Pushbullet](https://www.pushbullet.com/) makes getting things on and off your phone easy and fast.
2 |
3 | Supported events: push, issue and pull request.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. Install the [Android client](https://play.google.com/store/apps/details?id=com.pushbullet.android) from the Android Market or a browser extension.
9 |
10 | 2. Login to [Pushbullet](https://www.pushbullet.com/account) and copy your api key.
11 |
12 | 3. Add your api key in the field above.
13 |
14 | If you want to send to a specific device, else leave the "Device iden" field blank:
15 |
16 | 4. Open [Pushbullet API](https://api.pushbullet.com/api/devices) and paste your api key to the username field, leave password empty.
17 |
18 | 5. Find your desired device from the output and copy it's iden to the field above.
19 |
--------------------------------------------------------------------------------
/lib/services/gemini.rb:
--------------------------------------------------------------------------------
1 | class Service::Gemini < Service
2 | string :server_url, :api_key
3 |
4 | def receive_push
5 | if data['server_url'].to_s.empty?
6 | raise_config_error "Server URL is missing"
7 | end
8 |
9 | if data['api_key'].to_s.empty?
10 | raise_config_error "API Key is missing"
11 | end
12 |
13 | # Sets this basic auth info for every request. GitHub user and Gemini API Key.
14 | http.basic_auth(data['api_key'], data['api_key'])
15 |
16 | # Every request sends JSON.
17 | http.headers['Content-Type'] = 'application/json'
18 |
19 | # Uses this URL as a prefix for every request.
20 | http.url_prefix = '%s/api/github' % [data['server_url']]
21 |
22 | # POST http://localhost/gemini/api/github/commit
23 | http_post "commit", generate_json(payload)
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/test/docker_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class DockerTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | data = {}
8 |
9 | payload = {'commits'=>[{'id'=>'test'}]}
10 | svc = service(data, payload)
11 |
12 | @stubs.post "/hooks/github" do |env|
13 | body = JSON.parse(env[:body])
14 |
15 | assert_equal env[:url].host, "registry.hub.docker.com"
16 | assert_equal 'test', body['payload']['commits'][0]['id']
17 | assert_match 'guid-', body['guid']
18 | assert_equal data, body['config']
19 | assert_equal 'push', body['event']
20 | [200, {}, '']
21 | end
22 |
23 | svc.receive_event
24 | @stubs.verify_stubbed_calls
25 | end
26 |
27 | def service_class
28 | Service::Docker
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/lib/services/weblate.rb:
--------------------------------------------------------------------------------
1 | class Service::Weblate < Service
2 | string :url
3 | white_list :url
4 |
5 | url "http://weblate.org/"
6 | logo_url "http://weblate.org/graphics/weblate-32.png"
7 | maintained_by :github => 'nijel'
8 |
9 | def receive_push
10 | url = data['url']
11 | url.gsub! /\s/, ''
12 |
13 | if url.empty?
14 | raise_config_error "Invalid URL: #{url.inspect}"
15 | end
16 |
17 | if url !~ /^https?\:\/\//
18 | url = "http://#{url}"
19 | end
20 |
21 | res = http_post "#{url}/hooks/github/",
22 | :payload => generate_json(payload)
23 |
24 | if res.status < 200 || res.status > 299
25 | raise_config_error "Failed with #{res.status}"
26 | end
27 | rescue URI::InvalidURIError
28 | raise_config_error "Invalid URL: #{data['url']}"
29 | end
30 | end
31 |
32 |
33 |
--------------------------------------------------------------------------------
/test/jaconda_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class JacondaTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/api/v2/rooms/r/notify/github.json" do |env|
10 | assert_equal 's.jaconda.im', env[:url].host
11 | assert_equal basic_auth(:rt, :X), env[:request_headers]['authorization']
12 | assert_match /(^|\&)payload=%7B%22a%22%3A1%7D($|\&)/, env[:body]
13 | assert_match "digest=d", env[:body]
14 | [200, {}, '']
15 | end
16 |
17 | svc = service(:push,
18 | { 'subdomain' => 's', 'digest' => 'd',
19 | 'room_id' => 'r', 'room_token' => 'rt'}, 'a' => 1)
20 | svc.receive_event
21 | end
22 |
23 | def service(*args)
24 | super Service::Jaconda, *args
25 | end
26 | end
27 |
28 |
--------------------------------------------------------------------------------
/docs/myget:
--------------------------------------------------------------------------------
1 | MyGet allows you to create and host your own NuGet feed. Include packages from
2 | the official NuGet feed or upload your own NuGet packages. We can also compile
3 | and package your source code from GitHub, BitBucket, CodePlex and more!
4 |
5 | The GitHub MyGet service can be used to trigger builds after changes have been
6 | pushed to your GitHub repository.
7 |
8 | Install Notes
9 | -------------
10 |
11 | 1. Login to https://www.myget.org. If you are on the Enterprise plan,
12 | login through that URL instead.
13 |
14 | 2. Navigate to the feed's build services setup for which you want to
15 | automatically trigger builds when changes have been pushed to GitHub.
16 |
17 | 3. For the build, copy the Hook (HTTP POST) URL into the Hook URL field.
18 |
19 | 4. Show your love for MyGet and include the Status badge in your README.md
20 |
--------------------------------------------------------------------------------
/lib/services/codeship.rb:
--------------------------------------------------------------------------------
1 | class Service::Codeship < Service::HttpPost
2 | string :project_uuid
3 |
4 | url "http://www.codeship.io"
5 | logo_url "http://www.codeship.io/logo_codeship_topbar.png"
6 |
7 | default_events :push, :pull_request
8 |
9 | maintained_by github: 'beanieboi',
10 | twitter: '@beanieboi'
11 | supported_by web: 'http://www.codeship.io/contact',
12 | email: 'support@codeship.io',
13 | twitter: '@codeship'
14 |
15 | def receive_event
16 | http.headers['X-GitHub-Event'] = event.to_s
17 | http_post codeship_url, payload: generate_json(payload)
18 | end
19 |
20 | private
21 |
22 | def project_uuid
23 | required_config_value('project_uuid')
24 | end
25 |
26 | def codeship_url
27 | "https://lighthouse.codeship.io/github/#{project_uuid}"
28 | end
29 | end
30 |
--------------------------------------------------------------------------------
/test/scrumdo_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class ScrumDoTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/hooks/github/slug" do |env|
10 | assert_equal 'www.scrumdo.com', env[:url].host
11 | data = Faraday::Utils.parse_query(env[:body])
12 | assert_equal 'rick', data['username']
13 | assert_equal 'monkey', data['password']
14 | assert data['payload']
15 | [200, {}, '{}']
16 | end
17 |
18 | svc = service({
19 | 'username' => 'rick',
20 | 'password' => 'monkey',
21 | 'project_slug' => 'slug'
22 | }, payload)
23 |
24 | svc.receive_push
25 | end
26 |
27 | def service(*args)
28 | super Service::ScrumDo, *args
29 | end
30 | end
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/lib/services/lingohub.rb:
--------------------------------------------------------------------------------
1 | class Service::Lingohub < Service
2 |
3 | url "https://lingohub.com"
4 | logo_url "https://lingohub.com/assets/public/press/media_kit/lingohub_logo.jpg"
5 |
6 | maintained_by :github => 'lingohub'
7 |
8 | supported_by :web => 'http://support.lingohub.com',
9 | :email => 'support@lingohub.com'
10 |
11 | default_events :push
12 | password :project_token
13 |
14 | def receive_push
15 | project_token = data['project_token']
16 |
17 | if project_token.nil?
18 | raise_config_error "You have to specify a Project Token"
19 | end
20 |
21 | res = http_post "http://lingohub.com/github_callback?auth_token=#{project_token}",
22 | :payload => generate_json(payload)
23 |
24 | if res.status < 200 || res.status > 299
25 | raise_config_error res.body
26 | end
27 | end
28 | end
29 |
--------------------------------------------------------------------------------
/test/skydeskprojects_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class SkyDeskProjectsTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | url = "/serviceHook"
10 | data = {
11 | "project_id" => "1234",
12 | "token" => "a13d",
13 | }
14 | svc = service(data, payload)
15 | @stubs.post url do |env|
16 | assert_equal 'projects.skydesk.jp', env[:url].host
17 | params = Faraday::Utils.parse_query(env[:body])
18 | assert_equal '1234', params['pId']
19 | assert_equal 'a13d', params['authtoken']
20 | assert_equal payload, JSON.parse(params['payload'])
21 | [200, {}, '']
22 |
23 | end
24 | svc.receive
25 | end
26 |
27 | def service(*args)
28 | super Service::SkyDeskProjects, *args
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/lib/services/freckle.rb:
--------------------------------------------------------------------------------
1 | class Service::Freckle < Service::HttpPost
2 | string :subdomain, :project
3 | password :token
4 | white_list :subdomain, :project
5 |
6 | default_events :push
7 |
8 | url "https://letsfreckle.com"
9 |
10 | maintained_by :github => 'LockeCole117', :twitter => '@LockeCole117'
11 |
12 | supported_by :web => 'https://letsfreckle.com',
13 | :email => 'support@letsfreckle.com',
14 | :twitter => '@letsfreckle'
15 |
16 | def receive_event
17 | subdomain = required_config_value('subdomain').strip
18 | token = required_config_value('token').strip
19 | project = required_config_value('project').strip
20 |
21 | http.headers['X-FreckleToken'] = token
22 | http.headers['X-FreckleProject'] = project
23 | url = "https://#{data['subdomain']}.letsfreckle.com/api/github/commits"
24 | deliver url
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/test/apiary_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class ApiaryTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | options = {
7 | 'branch' => 'master',
8 | 'domain' => 'testvanity',
9 | 'apiary_address' => nil }
10 | @svc = service(options, nil)
11 | end
12 |
13 | def test_push
14 | @stubs.post "/github/service-hook" do |env|
15 | body = Faraday::Utils.parse_query(env[:body])
16 | assert_equal 'api.apiary.io', env[:url].host
17 | assert_equal @svc.payload, JSON.parse(body['payload'])
18 | assert_equal @svc.branch, body['branch']
19 | assert_equal @svc.domain, body['vanity']
20 | [200, {}, '']
21 | end
22 | @svc.receive_event
23 | end
24 |
25 | def service(*args)
26 | super Service::Apiary, *args
27 | end
28 | end
29 |
--------------------------------------------------------------------------------
/test/zohoprojects_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class ZohoProjectsTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def data
9 | {
10 | "project_id" => "1234",
11 | "token" => "a13d",
12 | }
13 | end
14 |
15 | def test_push
16 | url = "/serviceHook"
17 | @stubs.post url do |env|
18 | assert_equal 'projects.zoho.com', env[:url].host
19 | params = Faraday::Utils.parse_query env[:body]
20 | assert_equal '1234', params['pId']
21 | assert_equal 'a13d', params['authtoken']
22 | assert_equal payload, JSON.parse(params['payload'])
23 | [200, {}, '']
24 | end
25 |
26 | svc = service :push, data, payload
27 | svc.receive
28 | end
29 |
30 | def service(*args)
31 | super Service::ZohoProjects, *args
32 | end
33 | end
34 |
35 |
--------------------------------------------------------------------------------
/docs/kanbanize:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. **Kanbanize domain name** - Your project Kanbanize domain name Ex: **mycompany.kanbanize.com**
5 | 2. **Kanbanize api key** - The API key of a Kanbanize user account. We recommend using a dedicated Administrator user or a standard user (e.g. GitHub_user) with permissions to access, comment and modify cards on the desired boards.
6 | 3. **Branch Filter** - A Comma-separated list of branches which will be automatically inspected. Leave blank to include all branches.
7 | 4. **Restrict to Last Commit** - Only the last commit of each push will be inspected for task IDs.
8 | 5. **Track Project Issues In Kanbanize** - Open/Move to Done a card when a project issue is Open/Closed
9 | 6. **Project Issues Board Id** - The ID of the board that must keep the project issue cards. You can see the board ID on the Kanbanize dashboard screen, next to the board name.
10 |
--------------------------------------------------------------------------------
/lib/services/pushbullet.rb:
--------------------------------------------------------------------------------
1 | class Service::Pushbullet < Service::HttpPost
2 | string :api_key, :device_iden
3 |
4 | default_events :push, :issues, :pull_request
5 |
6 | url "https://www.pushbullet.com/"
7 | logo_url "https://www.pushbullet.com/img/header-logo.png"
8 |
9 | maintained_by :github => 'tuhoojabotti',
10 | :twitter => 'tuhoojabotti',
11 | :web => 'http://tuhoojabotti.com/#contact'
12 |
13 | supported_by :web => 'https://www.pushbullet.com/help',
14 | :email => 'hey@pushbullet.com'
15 |
16 | def receive_event
17 | unless required_config_value('api_key').match(/^[A-Za-z0-9\.]+$/)
18 | raise_config_error "Invalid api key."
19 | end
20 | unless config_value('device_iden').match(/^([A-Za-z0-9]+|)$/)
21 | raise_config_error "Invalid device iden."
22 | end
23 |
24 | deliver "https://webhook.pushbullet.com:443/github"
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/docs/skydeskprojects:
--------------------------------------------------------------------------------
1 | SkyDesk Projects Requirements:
2 |
3 | Log into the SkyDesk portal first.
4 | SkyDesk Portal URL : https://www.skydesk.jp
5 | Then access SkyDesk projects using https://projects.skydesk.jp.
6 |
7 | Project ID and Token is required for configuration which will be available under "Dashboard" --> "Project Settings" --> "Service Hooks".
8 |
9 | This service hook allows you to associate changeset(s) with bug(s) in SkyDesk Projects. To associate changeset(s) with bug(s) in SkyDeskProjects you will need to give the BUG ID in in your commit message.
10 |
11 | Syntax: `OPEN SQUARE BRACKET #BUGID CLOSE SQUARE BRACKET` followed by commit message
12 |
13 | Ex: `[#SDP-23] fixed the memory leak issue.`
14 |
15 | This will associate the changeset with bug with ID SDP-23.
16 |
17 | For more than one bugs, provide the BUG IDS separated by comma.
18 |
19 | Ex: `[#SDP-24,#SDP-25] UI alignment fix done.`
20 |
--------------------------------------------------------------------------------
/test/divecloud_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class DiveCloudTest < Service::TestCase
4 |
5 |
6 | def setup
7 | @stubs = Faraday::Adapter::Test::Stubs.new
8 | @data = { 'api_key' => 'Test_Api_Key', 'plan_id' => '833', 'creds_pass' => 'testtest', 'random_timing' => true, }
9 | @payload = { 'status' => 'success' }
10 | end
11 |
12 | def test_deployment_status
13 |
14 | @stubs.post "/api/v1/plans/833/run" do |env|
15 | assert_equal "application/json", env[:request_headers]["Content-Type"]
16 | assert_equal "Test_Api_Key", env[:request_headers]['x-api']
17 | [200, {}, '']
18 | end
19 |
20 | svc = service(:deployment_status, @data, @payload)
21 | svc.receive_deployment_status
22 |
23 | end
24 |
25 | def service(*args)
26 | super Service::DiveCloud, *args
27 | end
28 |
29 |
30 | end
--------------------------------------------------------------------------------
/test/sprintly_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class SprintlyTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/integration/github/1/push/" do |env|
10 | assert_equal 'sprint.ly', env[:url].host
11 | assert_equal 'application/json',
12 | env[:request_headers]['content-type']
13 | assert_equal basic_auth("my_user@foo.bar", "my_api_key"),
14 | env[:request_headers]['authorization']
15 | [200, {}, '']
16 | end
17 |
18 | svc = service :push, {
19 | 'email' => 'my_user@foo.bar',
20 | 'product_id' => '1',
21 | 'api_key' => 'my_api_key'
22 | }, payload
23 |
24 | svc.receive_event
25 | @stubs.verify_stubbed_calls
26 | end
27 |
28 | def service(*args)
29 | super Service::Sprintly, *args
30 | end
31 | end
32 |
--------------------------------------------------------------------------------
/lib/services/gemnasium.rb:
--------------------------------------------------------------------------------
1 | class Service::Gemnasium < Service
2 | string :user
3 | password :token
4 | white_list :user
5 |
6 | def receive_push
7 | http.basic_auth(user, signature)
8 | http_post(url, body, headers)
9 | end
10 |
11 | def http(*)
12 | super.tap{|h| h.builder.delete(Faraday::Request::UrlEncoded) }
13 | end
14 |
15 | def user
16 | data["user"].strip
17 | rescue
18 | raise_config_error "Invalid user value"
19 | end
20 |
21 | def signature
22 | Digest::SHA2.hexdigest(token + body)
23 | end
24 |
25 | def token
26 | data["token"].strip.downcase
27 | rescue
28 | raise_config_error "Invalid token value"
29 | end
30 |
31 | def body
32 | generate_json(payload)
33 | end
34 |
35 | def url
36 | "https://gemnasium.com/repositories/hook"
37 | end
38 |
39 | def headers
40 | {:content_type => "application/json"}
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/lib/services/sifter.rb:
--------------------------------------------------------------------------------
1 | class Service::Sifter < Service
2 | string :subdomain
3 | password :token
4 |
5 | def receive_push
6 | http.ssl[:verify] = false
7 |
8 | http_post hook_url do |req|
9 | req.params[:token] = token
10 | req.headers['Content-Type'] = 'application/json'
11 | req.body = generate_json(payload)
12 | end
13 | end
14 |
15 | def hook_url
16 | # For development/troubleshooting, the host and protocol can be set
17 | # with the SIFTER_HOST variable, e.g. SIFTER_HOST=http://sifter.dev
18 | host = ENV.fetch('SIFTER_HOST', 'sifterapp.com')
19 | proto = ENV.has_key?('SIFTER_HOST') ? 'http' : 'https'
20 |
21 | "#{proto}://#{subdomain}.#{host}/api/github"
22 | end
23 |
24 | def subdomain
25 | data["subdomain"].to_s.strip
26 | end
27 |
28 | def token
29 | data["token"].to_s.strip
30 | end
31 |
32 | end
33 |
34 |
--------------------------------------------------------------------------------
/lib/service/events/issue_helpers.rb:
--------------------------------------------------------------------------------
1 | module Service::IssueHelpers
2 | include Service::HelpersWithMeta,
3 | Service::HelpersWithActions
4 |
5 | def issue
6 | @issue ||= self.class.objectify(payload['issue'])
7 | end
8 |
9 | def summary_url
10 | issue.html_url
11 | end
12 |
13 | def summary_message
14 | "[%s] %s %s issue #%d: %s" % [
15 | repo.name,
16 | sender.login,
17 | action,
18 | issue.number,
19 | issue.title]
20 | rescue
21 | raise_config_error "Unable to build message: #{$!.to_s}"
22 | end
23 |
24 | def self.sample_payload
25 | Service::HelpersWithMeta.sample_payload.merge(
26 | "action" => "opened",
27 | "issue" => {
28 | "number" => 5,
29 | "state" => "open",
30 | "title" => "booya",
31 | "body" => "boom town",
32 | "user" => { "login" => "mojombo" }
33 | }
34 | )
35 | end
36 | end
37 |
--------------------------------------------------------------------------------
/lib/services/prowl.rb:
--------------------------------------------------------------------------------
1 | class Service::Prowl < Service
2 | string :apikey
3 |
4 | def receive_push
5 | return if payload['commits'].blank?
6 | url = URI.parse('https://api.prowlapp.com/publicapi/add')
7 | repository = payload['repository']['url'].split("/")
8 | event = [repository[-2], repository[-1]].join('/')
9 | application = "GitHub"
10 | description = "#{payload['commits'].length} commits pushed to #{application} (#{payload['commits'][-1]['id'][0..7]}..#{payload['commits'][0]['id'][0..7]})
11 |
12 | Latest Commit by #{payload['commits'][-1]['author']['name']}
13 | #{payload['commits'][-1]['id'][0..7]} #{payload['commits'][-1]['message']}"
14 |
15 | http_post 'https://api.prowlapp.com/publicapi/add',
16 | :apikey => data['apikey'],
17 | :application => application,
18 | :event => event,
19 | :description => description,
20 | :url => payload['compare']
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/lib/services/icescrum.rb:
--------------------------------------------------------------------------------
1 | class Service::IceScrum < Service
2 | string :base_url, :project_key, :username
3 | password :password
4 | def receive_push
5 | raise_config_error "Invalid username" if data['username'].to_s.empty?
6 | raise_config_error "Invalid password" if data['password'].to_s.empty?
7 | raise_config_error "Invalid project key" if data['project_key'].to_s.empty?
8 |
9 | username = data['username'].to_s.gsub(/\s+/, "")
10 | project_key = data['project_key'].to_s.upcase.gsub(/\s+/, "")
11 | password = data['password'].to_s.gsub(/\s+/, "")
12 |
13 | if data['base_url'].present?
14 | url = "#{data['base_url']}/ws/p/#{project_key}/commit"
15 | else
16 | url = "https://www.kagilum.com/a/ws/p/#{project_key}/commit"
17 | end
18 |
19 | http.ssl[:verify] = false
20 | http.basic_auth username, password
21 |
22 | http_post url, { :payload => generate_json(payload) }
23 | end
24 |
25 | end
26 |
27 |
--------------------------------------------------------------------------------
/test/codeship_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class CodeshipTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push_event
7 | project_uuid = '2fe6bdb0-a6db-0131-f25b-0088653824b4'
8 |
9 | data = { 'project_uuid' => project_uuid }
10 |
11 | svc = service(:push, data, payload)
12 |
13 | @stubs.post "/github/#{project_uuid}" do |env|
14 | body = Faraday::Utils.parse_query env[:body]
15 | assert_equal "https://lighthouse.codeship.io/github/#{project_uuid}", env[:url].to_s
16 | assert_match 'application/x-www-form-urlencoded', env[:request_headers]['Content-Type']
17 | assert_equal 'push', env[:request_headers]['X-GitHub-Event']
18 | assert_equal payload, JSON.parse(body["payload"].to_s)
19 | end
20 |
21 | svc.receive_event
22 | end
23 |
24 | private
25 |
26 | def service_class
27 | Service::Codeship
28 | end
29 | end
30 |
--------------------------------------------------------------------------------
/docs/zendesk:
--------------------------------------------------------------------------------
1 | Zendesk is the fastest way to great customer service. Use this service hook to selectively update tickets with private comments based on GitHub commit messages and issue updates.
2 |
3 | In order to update a Zendesk ticket, all you need to do is to configure and enable this hook, and then subsequently reference the ticket you want updated with the GitHub status. The format of the ticket reference is ZD#123 where 123 is the id of the ticket. Only commits/comments containing a valid ZD ticket reference are sent to Zendesk.
4 |
5 | Install Notes
6 | -------------
7 |
8 | 1. The subdomain is your Zendesk subdomain, i.e. "subdomain" if you visit https://subdomain.zendesk.com
9 |
10 | 2. Username is the email address of the user you wish to authenticate as
11 |
12 | 3. Password is either the password of the user, or your Zendesk API token from "Settings / Channel / API". Remember to adjust the username if you use the API token.
13 |
14 |
--------------------------------------------------------------------------------
/lib/service/structs.rb:
--------------------------------------------------------------------------------
1 | class Service
2 | module StructLoading
3 | def from(hash)
4 | new *members.map { |attr| hash[attr.to_s] }
5 | end
6 | end
7 |
8 | class Meta < Struct.new(:id, :sender, :repository)
9 | def self.from(hash)
10 | sender = User.from(hash['sender'])
11 | repository = Repository.from(hash['repository'])
12 | repository.owner = User.from(hash['user'])
13 | new hash['id'], sender, repository
14 | end
15 | end
16 |
17 | class User < Struct.new(:id, :login, :gravatar_id)
18 | extend StructLoading
19 |
20 | def url
21 | "https://github.com/#{login}"
22 | end
23 | end
24 |
25 | class Repository < Struct.new(:id, :source_id, :name, :owner)
26 | extend StructLoading
27 |
28 | def name_with_owner
29 | @name_with_owner ||= "#{owner.login}/#{name}"
30 | end
31 |
32 | def url
33 | owner.url << "/#{name}"
34 | end
35 | end
36 | end
37 |
--------------------------------------------------------------------------------
/docs/twitter:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | 1. [Get an OAuth Token for Your Twitter Account][authorize_url].
5 | 2. You're going to be redirected to Twitter to allow GitHub to tweet on your behalf.
6 | 3. Be sure that you're logged in as the Twitter user you would like to tweet from.
7 |
8 | Check "Digest" to send only the number of recent commits to a branch along with a link to that branches
9 | commit list, instead of tweeting all commits individually with their message and direct link to each commit.
10 |
11 | Check "Short format" to omit the repository and commiter's names from the tweet to get more
12 | space for the commit message.
13 |
14 | If you would like to only receive messages for a specific branch, add the name (or partial name) to
15 | the "Filter branch" option. Otherwise, leave the field blank to receive messages for all branches.
16 |
17 | [authorize_url]: <%= twitter_oauth_path(current_repository.user, current_repository) %>
18 |
--------------------------------------------------------------------------------
/lib/services/jaconda.rb:
--------------------------------------------------------------------------------
1 | class Service::Jaconda < Service
2 | string :subdomain, :room_id
3 | password :room_token
4 | boolean :digest
5 | white_list :subdomain, :room_id
6 |
7 | default_events :commit_comment, :download, :fork, :fork_apply, :gollum,
8 | :issues, :issue_comment, :member, :public, :pull_request, :push, :watch
9 |
10 | def receive_event
11 | raise_config_error "Missing 'subdomain'" if data['subdomain'].to_s.empty?
12 | raise_config_error "Missing 'room_id'" if data['room_id'].to_s.empty?
13 |
14 | http.basic_auth data['room_token'], 'X'
15 |
16 | res = http_post "https://#{data['subdomain']}.jaconda.im/api/v2/rooms/#{data['room_id']}/notify/github.json",
17 | :payload => generate_json(payload),
18 | :digest => data['digest'],
19 | :event => event
20 |
21 | if res.status < 200 || res.status > 299
22 | raise_config_error "#{res.status}: #{res.body}"
23 | end
24 | end
25 | end
26 |
27 |
--------------------------------------------------------------------------------
/test/landscape_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class LandscapeTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | data = {}
8 | payload = {
9 | 'commits'=>[{'id'=>'test'}],
10 | 'repository'=>{'id'=>'repoid'}
11 | }
12 |
13 | svc = service(data, payload)
14 |
15 | @stubs.post "/hooks/github" do |env|
16 | body = JSON.parse(env[:body])
17 |
18 | assert_equal env[:url].host, "landscape.io"
19 | assert_equal 'test', body['payload']['commits'][0]['id']
20 | assert_match 'guid-', body['guid']
21 | assert_equal data, body['config']
22 | assert_equal 'push', body['event']
23 | assert_equal 'repoid', body['payload']['repository']['id']
24 | [200, {}, '']
25 | end
26 |
27 | svc.receive_event
28 | @stubs.verify_stubbed_calls
29 | end
30 | def service_class
31 | Service::Landscape
32 | end
33 | end
34 |
35 |
--------------------------------------------------------------------------------
/docs/flowdock:
--------------------------------------------------------------------------------
1 | Broadcast this project's commits, pull requests, issues, and their
2 | respective comments to Flowdock.
3 |
4 | Install Notes
5 | -------------
6 |
7 | API Token is a flow-specific token. You can find it either in the flow, or in Flowdock's Integrations help page at https://www.flowdock.com/help/integrations.
8 |
9 | Multiple flows may be specified with multiple comma-separated tokens.
10 |
11 | To include certain tags with every message, you can add tags to the tokens. Use + to separate tags. For example, "65f80e994031fcd80f57d1a9e294c1d1d+frontend+web,af8629b07978d1223c9d48d05ff1356+fyi" would add `frontend` and `web` tags to the messages posted to the first flow, and `fyi` to the messages posted to the second flow.
12 |
13 | Configure From Flowdock
14 | -----------------------
15 |
16 | You can also configure hooks from within Flowdock. Those hooks will appear in the `Web Hooks` category of the service hooks. This can be done from the flow’s inbox settings.
17 |
--------------------------------------------------------------------------------
/docs/tddium:
--------------------------------------------------------------------------------
1 | Tddium Continuous Integration
2 |
3 | Learn more at [tddium.com](https://www.tddium.com).
4 |
5 | Install Notes
6 | -------------
7 |
8 | This hook will be automatically configured for GitHub repos you've configured
9 | with a connected Tddium account.
10 |
11 | If you don't want to connect your GitHub account, or you don't want to give
12 | Tddium `repo` privileges, follow these steps:
13 |
14 | 1. Go to your Tddium dashboard
15 | 2. Open the Configuration page for this repo and click on the 'CI Setup' section
16 | 3. Copy the hex value listed under 'CI Token'
17 | 4. Paste the token above.
18 | 5. Install Tddium's repo-specific public key into this repo's deploy keys.
19 |
20 | You can safely leave the Override URL field blank.
21 |
22 | Supported Events
23 | ----------------
24 |
25 | Tddium monitors all events on your repo, but it currently only acts on:
26 |
27 | - push
28 | - create a branch
29 | - delete a branch
30 | - open, close, synchronize pull requests
31 |
--------------------------------------------------------------------------------
/test/flowdock_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class FlowdockTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | @tokens = "token1,token2"
7 | end
8 |
9 | def test_push
10 | @stubs.post "/v1/github/#{@tokens}" do |env|
11 | assert_match /json/, env[:request_headers]['content-type']
12 | assert_equal push_payload, JSON.parse(env[:body])
13 | [200, {}, '']
14 | end
15 |
16 | svc = service(
17 | {'token' => @tokens}, push_payload)
18 | svc.receive_event
19 | end
20 |
21 | def test_token_sanitization
22 | @stubs.post "/v1/github/#{@tokens}" do |env|
23 | assert_equal payload, JSON.parse(env[:body])
24 | [200, {}, '']
25 | end
26 |
27 | svc = service(
28 | {'token' => " " + @tokens + " "}, payload)
29 | svc.receive_event
30 | end
31 |
32 | def service(*args)
33 | super Service::Flowdock, *args
34 | end
35 | end
36 |
37 |
--------------------------------------------------------------------------------
/lib/services/leanpub.rb:
--------------------------------------------------------------------------------
1 | class Service::Leanpub < Service::HttpPost
2 | string :api_key, :slug
3 |
4 | white_list :slug
5 |
6 | default_events :push
7 |
8 | url "https://leanpub.com"
9 | logo_url "https://leanpub.com/assets/leanpub_logo_small.png"
10 |
11 | maintained_by :github => 'spatten',
12 | :email => 'scott@leanpub.com',
13 | :twitter => '@scott_patten'
14 |
15 | supported_by :web => 'https://leanpub.com/contact',
16 | :email => 'hello@leanpub.com',
17 | :twitter => '@leanpub'
18 |
19 | def receive_event
20 | slug = required_config_value('slug')
21 | api_key = required_config_value('api_key')
22 |
23 | if api_key.match(/^[A-Za-z0-9_-]+$/) == nil
24 | raise_config_error "Invalid api key"
25 | end
26 |
27 | if slug.match(/^[A-Za-z0-9_-]+$/) == nil
28 | raise_config_error "Invalid slug"
29 | end
30 |
31 | url = "https://leanpub.com:443/#{slug}/preview?api_key=#{api_key}"
32 | deliver url
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/test/huboard_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class HuBoardTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_issues
9 | @stubs.post "api/site/webhook/issue" do |env|
10 | assert_equal 'huboard.com', env[:url].host
11 | assert_equal 'application/x-www-form-urlencoded',
12 | env[:request_headers]['content-type']
13 | [200, {}, '']
14 | end
15 |
16 | service(issues_payload).receive_issues
17 | end
18 |
19 | def test_comment
20 | @stubs.post "api/site/webhook/comment" do |env|
21 | assert_equal 'huboard.com', env[:url].host
22 | assert_equal 'application/x-www-form-urlencoded',
23 | env[:request_headers]['content-type']
24 | [200, {}, '']
25 | end
26 |
27 | service(issue_comment_payload).receive_issue_comment
28 | end
29 |
30 | def service(payload)
31 | super Service::HuBoard, {}, payload
32 | end
33 | end
34 |
35 |
--------------------------------------------------------------------------------
/lib/services/apiary.rb:
--------------------------------------------------------------------------------
1 | class Service::Apiary < Service::HttpPost
2 | string :branch, :domain
3 | white_list :branch
4 | default_events :push
5 |
6 | url "http://apiary.io"
7 | logo_url "http://static.apiary.io/css/design2/apiary-io-symbol-1x.png"
8 | maintained_by :github => 'tu1ly'
9 | supported_by :web => 'http://support.apiary.io/',
10 | :email => 'support@apiary.io'
11 |
12 | APIARY_URL = "http://api.apiary.io/github/service-hook"
13 |
14 | def make_apiary_call
15 | return true if not domain
16 | http_post APIARY_URL,
17 | :payload => generate_json(payload),
18 | :branch => branch,
19 | :vanity => domain
20 | end
21 |
22 | def branch
23 | @branch ||= (not data['branch'].to_s.strip.empty?) ? data['branch'].to_s.strip : 'master'
24 | end
25 |
26 | def domain
27 | @domain ||= (not data['domain'].to_s.strip.empty?) ? data['domain'].to_s.strip : nil
28 | end
29 |
30 | def receive_event
31 | return make_apiary_call
32 | end
33 | end
34 |
--------------------------------------------------------------------------------
/test/myget_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class MyGetTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | test_hook_url = "https://www.myget.org/BuildSource/Hook/feedname?identifier=guid"
8 | test_hook_pathandquery = "/BuildSource/Hook/feedname?identifier=guid"
9 |
10 | data = {
11 | 'hook_url' => test_hook_url
12 | }
13 |
14 | payload = {'commits'=>[{'id'=>'test'}]}
15 | svc = service(data, payload)
16 |
17 | @stubs.post "#{test_hook_pathandquery}" do |env|
18 | body = JSON.parse(env[:body])
19 |
20 | assert_equal 'test', body['payload']['commits'][0]['id']
21 | assert_match 'guid-', body['guid']
22 | assert_equal data, body['config']
23 | assert_equal 'push', body['event']
24 | [201, {}, '']
25 | end
26 |
27 | svc.receive_event
28 | @stubs.verify_stubbed_calls
29 | end
30 |
31 | def service_class
32 | Service::MyGet
33 | end
34 | end
35 |
36 |
--------------------------------------------------------------------------------
/lib/services/sprintly.rb:
--------------------------------------------------------------------------------
1 | class Service::Sprintly < Service
2 | default_events :commit_comment, :create, :delete, :download,
3 | :follow, :fork, :fork_apply, :gist, :gollum, :issue_comment,
4 | :issues, :member, :public, :pull_request, :push, :team_add,
5 | :watch, :pull_request_review_comment, :status
6 | string :email, :api_key, :product_id
7 | white_list :email, :product_id
8 |
9 | def receive_event
10 | raise_config_error "Must provide an api key" if data['api_key'].to_s.empty?
11 | raise_config_error "Must provide an email address." if data['email'].to_s.empty?
12 | raise_config_error "Must provide a product id." if data['product_id'].to_s.empty?
13 | host_name = ENV['SPRINTLY_DEBUG_HOST'] || "https://sprint.ly"
14 |
15 | http.headers['Content-Type'] = 'application/json'
16 | http.basic_auth(data['email'], data['api_key'])
17 |
18 | http_post "#{host_name}/integration/github/#{data['product_id']}/#{event}/", generate_json(payload)
19 | end
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/test/deployervc_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class DeployervcTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | test_deployment_address = 'https://emre.deployer.vc/#/deployment/1'
8 | test_api_token = 'this_is_a_test_token'
9 |
10 | data = {
11 | 'deployment_address' => test_deployment_address,
12 | 'api_token' => test_api_token
13 | }
14 |
15 | payload = {'commits'=>[{'id'=>'test'}]}
16 | svc = service(data, payload)
17 |
18 | @stubs.post '/api/v1/deployments/deploy/1' do |env|
19 | body = JSON.parse(env[:body])
20 |
21 | assert_equal env[:url].host, 'emre.deployer.vc'
22 | assert_equal env[:request_headers]['X-Deployervc-Token'], test_api_token
23 | assert_equal '', body['revision']
24 | [200, {}, '']
25 | end
26 |
27 | svc.receive_event
28 | @stubs.verify_stubbed_calls
29 | end
30 |
31 | def service_class
32 | Service::Deployervc
33 | end
34 | end
--------------------------------------------------------------------------------
/lib/services/skydeskprojects.rb:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | class Service::SkyDeskProjects < Service::HttpPost
3 | string :project_id
4 | password :token
5 |
6 | white_list :project_id
7 |
8 | url "https://www.skydesk.jp"
9 | logo_url "https://www.skydesk.jp/static/common/images/header/ci/ci_skydesk.gif"
10 |
11 | maintained_by :github => 'SkyDeskProjects'
12 |
13 | supported_by :web => 'www.skydesk.jp/en/contact/',
14 | :email => 'support_projects@skydesk.jp'
15 |
16 | def receive_push
17 | token = required_config_value('token')
18 | pId = required_config_value('project_id')
19 | #http.headers['Authorization'] = "Token #{token}"
20 |
21 | #url = "https://projects.skydesk.jp/serviceHook"
22 | res = http_post "https://projects.skydesk.jp/serviceHook",
23 | :pId => pId,
24 | :authtoken => token,
25 | :scope => "projectsapi",
26 | :payload => generate_json(payload)
27 | if res.status != 200
28 | raise_config_error
29 | end
30 | end
31 | end
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
3 |
4 | **_GitHub Services has been deprecated_. No more contributions will be accepted. Please see our [blog post](https://developer.github.com/changes/2018-04-25-github-services-deprecation/) for more information.**
5 |
6 | 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
7 |
8 | GitHub Services
9 | ===============
10 |
11 | This repository contains code to integrate GitHub.com with third party services.
12 |
13 | See the [Contributing Guidelines](https://github.com/github/github-services/blob/master/.github/CONTRIBUTING.md) for instructions on contributing a service.
14 |
15 | Current Status
16 | ==============
17 |
18 | Please note: GitHub will only accept pull requests to existing services that implement bug fixes or security improvements. We no longer accept feature changes to existing services.
19 |
20 | [](https://travis-ci.org/github/github-services)
21 |
--------------------------------------------------------------------------------
/test/iron_mq_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class IronMQTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/v1/webhooks/github" do |env|
10 | form = Faraday::Utils.parse_query(env[:body])
11 | p form
12 | assert_equal payload, JSON.parse(form['payload'])
13 | assert_equal 't', form['token']
14 | assert_equal '123', form['project_id']
15 | [200, {}, '']
16 | end
17 |
18 | token = 'x'
19 | project_id = '111122223333444455556666'
20 | svc = service(
21 | {
22 | 'token' => token,
23 | 'project_id' => project_id
24 | },
25 | payload)
26 | data, payload, resp = svc.receive_event
27 | assert_equal token, data['token']
28 | assert_equal project_id, data['project_id']
29 | assert_equal 200, resp.code
30 | end
31 |
32 | def service(*args)
33 | super Service::IronMQ, *args
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/lib/services/clever_cloud.rb:
--------------------------------------------------------------------------------
1 | class Service::CleverCloud < Service
2 | include HttpHelper
3 |
4 | self.title = 'Clever Cloud'
5 |
6 | password :secret
7 |
8 | default_events :push
9 |
10 | url "https://www..clever-cloud.com/"
11 | logo_url "http://cleverstatic.cleverapps.io/twitter-cards-assets/tw-card-logo.png"
12 | maintained_by :github => 'Keruspe'
13 | supported_by :web => 'https://www.clever-cloud.com/',
14 | :email => 'support@clever-cloud.com'
15 |
16 | def receive_push
17 | secret_ok = required_config_value ("secret")
18 |
19 | http.headers['X-GitHub-Event'] = event.to_s
20 | http.headers['X-GitHub-Delivery'] = delivery_guid.to_s
21 |
22 | res = deliver 'https://api.clever-cloud.com/v2/github/redeploy/', :content_type => 'application/json', :secret => secret_ok
23 |
24 | if res.status < 200 || res.status > 299
25 | raise_config_error "Invalid HTTP Response: #{res.status}"
26 | end
27 | end
28 |
29 | def original_body
30 | payload
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/lib/services/deploy_hq.rb:
--------------------------------------------------------------------------------
1 | class Service::DeployHq < Service
2 | string :deploy_hook_url
3 | boolean :email_pusher
4 |
5 | url "http://www.deployhq.com/"
6 | logo_url "http://www.deployhq.com/images/deploy/logo.png"
7 | maintained_by :github => 'darkphnx'
8 | supported_by :web => 'http://support.deployhq.com/', :email => 'support@deployhq.com'
9 |
10 | def receive_push
11 | unless data['deploy_hook_url'].to_s =~ /^https:\/\/[a-z0-9\-\_]+\.deployhq.com\/deploy\/[a-z0-9\-\_]+\/to\/[a-z0-9\-\_]+\/[a-z0-9]+$/i
12 | raise_config_error "Deploy Hook invalid"
13 | end
14 | email_pusher = config_boolean_true?('email_pusher')
15 |
16 | http.url_prefix = data['deploy_hook_url']
17 | http.headers['content-type'] = 'application/x-www-form-urlencoded'
18 | http.headers['X-GitHub-Event'] = 'push'
19 |
20 | body = Faraday::Utils.build_nested_query(http.params.merge(:payload => generate_json(payload), :notify => email_pusher))
21 |
22 | http_post data['deploy_hook_url'], body
23 | end
24 |
25 | end
26 |
--------------------------------------------------------------------------------
/lib/services/phraseapp.rb:
--------------------------------------------------------------------------------
1 | class Service::Phraseapp < Service::HttpPost
2 | title "PhraseApp"
3 |
4 | password :auth_token
5 |
6 | white_list :auth_token
7 |
8 | default_events :push
9 |
10 | url "https://phraseapp.com"
11 | logo_url "https://phraseapp.com/assets/github/phraseapp-logo.png"
12 |
13 | maintained_by github: "docstun"
14 |
15 | supported_by web: "https://phraseapp.com/contact",
16 | email: "info@phraseapp.com",
17 | twitter: "@phraseapp"
18 |
19 | def receive_push
20 | auth_token = required_config_value("auth_token")
21 | raise_config_error "Invalid auth token" unless auth_token.match(/^[A-Za-z0-9]+$/)
22 |
23 | body = generate_json(hook_params)
24 | http_post(hook_uri, body) do |request|
25 | request.params[:auth_token] = auth_token
26 | end
27 | end
28 |
29 | protected
30 | def hook_uri
31 | "https://phraseapp.com:443/api/v1/hooks/github"
32 | end
33 |
34 | def hook_params
35 | {
36 | data: data,
37 | payload: payload
38 | }
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/docs/simperium:
--------------------------------------------------------------------------------
1 | This service posts an event object for GitHub events to a Simperium app.
2 | A Simperium object is created for each hook event in a bucket you choose.
3 |
4 | Supported events are currently:
5 | 'push', 'issues', 'issue_comment', 'commit_comment', 'pull_request',
6 | 'pull_request_review_comment', 'watch', 'fork', 'fork_apply',
7 | 'member', 'public', 'team_add', 'status'
8 |
9 | Simperium IDs:
10 | Each object ID will be a guid, eg. 'guid-0.3939192'
11 |
12 | Data:
13 | 'event' - The GitHub event type, eg. 'push' for commits
14 | 'payload' - The data for the event, varies by event type.
15 |
16 | More details on GitHub events: https://developer.github.com/v3/repos/hooks/
17 |
18 | Install Notes
19 | ------------
20 |
21 | App ID: Your Simperium app id created on https://simperium.com/dashboard
22 | Token: You'll need to generate an access token for a specific user (not an API key)
23 | Bucket: Name of the bucket you want events posted to
24 |
25 | See https://simperium.com/docs/reference/http/#auth for more details on Simperium authentication.
26 |
--------------------------------------------------------------------------------
/test/lingohub_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class LingohubTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_http_call
9 | @stubs.post "/github_callback" do |env|
10 | assert_equal 'lingohub.com', env[:url].host
11 | assert_equal 'a27f34', env[:params]['auth_token']
12 |
13 | [200, {}, '']
14 | end
15 |
16 | svc = service({'project_token' => 'a27f34'}, :a => 1)
17 | svc.receive_push
18 | end
19 |
20 | def test_payload
21 | @stubs.post "/github_callback" do |env|
22 |
23 | body = Faraday::Utils.parse_nested_query(env[:body])
24 | received_payload = JSON.parse(body['payload'])
25 |
26 | assert_equal payload['after'], received_payload['after']
27 |
28 | [200, {}, '']
29 | end
30 |
31 | svc = service({'project_token' => 'a27f34'}, payload)
32 | svc.receive_push
33 | end
34 |
35 |
36 |
37 | def service(*args)
38 | super Service::Lingohub, *args
39 | end
40 | end
41 |
42 |
--------------------------------------------------------------------------------
/test/jenkins_github_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class JenkinsGitHubTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/github-webhook/" do |env|
10 | assert_equal 'jenkins.example.com', env[:url].host
11 | assert_equal 'Basic bW9ua2V5OnNlY3JldA==',
12 | env[:request_headers]['authorization']
13 | assert_equal 'application/x-www-form-urlencoded',
14 | env[:request_headers]['content-type']
15 | [200, {}, '']
16 | end
17 |
18 | svc = service :push,
19 | {'jenkins_hook_url' => 'http://monkey:secret@jenkins.example.com/github-webhook/'}, payload
20 | svc.receive_push
21 | end
22 |
23 | def test_no_jenkins_hook_url
24 | assert_raises Service::ConfigurationError do
25 | svc = service :push,
26 | {'jenkins_hook_url' => ''}, payload
27 | svc.receive_push
28 | end
29 | end
30 |
31 | def service(*args)
32 | super Service::JenkinsGitHub, *args
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/lib/service/events/commit_comment_helpers.rb:
--------------------------------------------------------------------------------
1 | module Service::CommitCommentHelpers
2 | include Service::HelpersWithMeta
3 |
4 | def comment
5 | @comment ||= self.class.objectify(payload['comment'])
6 | end
7 |
8 | def summary_url
9 | comment.html_url
10 | end
11 |
12 | def summary_message
13 | "[%s] %s comment on commit %s: %s. %s" % [
14 | repo.name,
15 | sender.login,
16 | comment.commit_id,
17 | comment.body,
18 | comment.html_url
19 | ]
20 | rescue
21 | raise_config_error "Unable to build message: #{$!.to_s}"
22 | end
23 |
24 | def self.sample_payload
25 | comment_id = 3332777
26 | commit_id = "441e5686a726b79bcdace639e2591a60718c9719"
27 | Service::HelpersWithMeta.sample_payload.merge(
28 | "comment" => {
29 | "user" => { "login" => "defunkt" },
30 | "commit_id" => commit_id,
31 | "body" => "this\r\nis\r\ntest comment",
32 | "html_url" => "https://github.com/mojombo/magik/commit/#{commit_id}#commitcomment-#{comment_id}"
33 | }
34 | )
35 | end
36 | end
37 |
--------------------------------------------------------------------------------
/docs/jira:
--------------------------------------------------------------------------------
1 | This service hook allows you to transition JIRA tickets using the REST API available in
2 | version 4.2+ of JIRA. To interact with tickets in JIRA you will need to place markup
3 | similar to Lighthouse's in your commit message.
4 |
5 | Fixed an annoying bug [#WEB-210 transition:31 resolution:1]
6 |
7 | This will perform transition 31 with a resolution code of 1 on the issue WEB-210. You can specify
8 | any key value pair with the `key:value` notation, but at the very least transition must be present.
9 |
10 | NOTE: As of 2.0.alpha1, the REST API will not automatically interpret strings into integers and vice
11 | versa.
12 |
13 | Install Notes
14 | -------------
15 |
16 | A user in JIRA will need to be created for GitHub. It should be given full
17 | access to all projects.
18 |
19 | Using the following url as an example:
20 |
21 | http://jira.enmasse.com/rest/2.0.alpha1/issue/WEB-249
22 |
23 | 1. http://jira.enmasse.com is the server_hostname
24 | 2. 2.0.alpha1 is the api_version
25 | 3. username of the GitHub user in JIRA
26 | 4. password of the GitHub user in JIRA
27 |
--------------------------------------------------------------------------------
/lib/services/copperegg.rb:
--------------------------------------------------------------------------------
1 | class Service::CopperEgg < Service
2 | string :url, :tag
3 | boolean :master_only
4 | string :api_key
5 |
6 | def receive_push
7 |
8 | raise_config_error 'API Key must be set' if data['api_key'].blank?
9 |
10 | if config_boolean_true?('master_only') && branch_name != 'master'
11 | return
12 | end
13 |
14 | http.ssl[:verify] = false
15 | http.basic_auth(data['api_key'], "U")
16 | http.headers['Content-Type'] = 'application/json'
17 | if data['url'] != "" && data['url'] != nil
18 | url = data['url']
19 | else
20 | url = "https://api.copperegg.com/v2/annotations.json"
21 | end
22 | note = "GitHub: #{payload['pusher']['name']} has pushed #{payload['commits'].size} commit(s) to #{payload['repository']['name']}"
23 | body = {"note" => note, "starttime" => Time.now.to_i - 30, "endtime" => Time.now.to_i + 30, "tags" => data['tag']}
24 | json = generate_json(body)
25 |
26 | res = http_post url, json
27 | if res.status < 200 || res.status > 299
28 | raise_config_error
29 | end
30 | end
31 | end
32 |
--------------------------------------------------------------------------------
/test/unfuddle_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class UnfuddleTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.get '/api/v1/people.json' do |env|
10 | assert_equal 's.unfuddle.com', env[:url].host
11 | assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
12 | [200, {}, [{:email => 'tom@mojombo.com', :account_id => 1}].to_json]
13 | end
14 |
15 | @stubs.post '/api/v1/repositories/2/changesets.json' do |env|
16 | assert_equal 's.unfuddle.com', env[:url].host
17 | assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
18 | [200, {'Location' => '/abc'}, '']
19 | end
20 |
21 | @stubs.put '/abc' do
22 | [200, {}, '']
23 | end
24 |
25 | svc = service({
26 | 'repo_id' => '2.0', 'subdomain' => 's',
27 | 'username' => 'u', 'password' => 'p'}, payload)
28 | svc.receive_push
29 | end
30 |
31 | def service(*args)
32 | super Service::Unfuddle, *args
33 | end
34 | end
35 |
36 |
--------------------------------------------------------------------------------
/lib/services/toggl.rb:
--------------------------------------------------------------------------------
1 | class Service::Toggl < Service
2 | string :project
3 | password :api_token
4 | white_list :project
5 |
6 | def receive_push
7 | http.url_prefix = "https://www.toggl.com/api/v8"
8 | http.basic_auth data['api_token'], 'api_token'
9 | http.headers['Content-Type'] = 'application/json'
10 |
11 | payload["commits"].each do |commit|
12 | duration = (commit["message"].split(/\s/).find { |item| /t:/ =~ item } || "")[2,100]
13 | next unless duration
14 |
15 | # Toggl wants it in seconds. Commits should be in seconds
16 | duration = duration.to_i * 60
17 | http_post "time_entries", generate_json(
18 | :time_entry => {
19 | :duration => duration.to_i,
20 | :description => commit["message"].strip,
21 | :pid => data["project"],
22 | :start => (Time.now - duration.to_i).iso8601,
23 | :billable => true, # this is a pro feature, will be ignored for free version users
24 | :created_with => "github",
25 | :stop => Time.now.iso8601
26 | }
27 | )
28 | end
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/docs/asana:
--------------------------------------------------------------------------------
1 | This service adds commit messages as comments to Asana tasks. Once enabled, commit messages
2 | are checked for Asana task URLs (for example, https://app.asana.com/0/12345678/9012345) or task IDs
3 | starting with # (for example, #9012345). Every task ID found will get the commit comment added to it.
4 |
5 | A commit with the message:
6 |
7 | ```
8 | Fixes layout rendering bug. Reported in https://app.asana.com/0/12345678/9012345
9 | ```
10 |
11 | will show up as:
12 | ``` pushed to branch of /
13 | (https://github.com///commit/)
14 | -Fixes layout rendering bug. Reported in https://app.asana.com/0/12345678/9012345```
15 |
16 | Install Notes
17 | -------------
18 | 1. **Auth Token** - User API token. User must have access to task, all comments will be attributed to this user. See: https://developer.asana.com/documentation/#Authentication
19 | 2. **Restrict to Branch** - Comma-separated list of branches which will be automatically inspected. Leave blank to include all branches.
20 | 3. **Restrict to Last Commit** - Will only inspect the last commit of each push for task IDs.
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008 Logical Awesome, LLC
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/lib/services/gitter.rb:
--------------------------------------------------------------------------------
1 | class Service::Gitter < Service::HttpPost
2 | password :token
3 | boolean :mute_fork, :mute_watch, :mute_comments, :mute_wiki
4 |
5 | default_events ALL_EVENTS
6 |
7 | url 'https://gitter.im'
8 | logo_url 'https://gitter.im/_s/1/images/2/gitter/logo-blue-text.png'
9 |
10 | maintained_by github: 'malditogeek',
11 | twitter: '@malditogeek'
12 |
13 | supported_by github: 'gitterHQ',
14 | twitter: '@gitchat',
15 | email: 'support@gitter.im'
16 |
17 | def receive_event
18 | token = required_config_value('token')
19 | raise_config_error 'Invalid token' unless token.match(/^\w+$/)
20 |
21 | return if config_boolean_true?('mute_fork') && event.to_s =~ /fork/
22 | return if config_boolean_true?('mute_watch') && event.to_s =~ /watch/
23 | return if config_boolean_true?('mute_comments') && event.to_s =~ /comment/
24 | return if config_boolean_true?('mute_wiki') && event.to_s =~ /gollum/
25 |
26 | http.headers['X-GitHub-Event'] = event.to_s
27 |
28 | deliver "https://webhooks.gitter.im/e/#{token}"
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/docs/commandoio:
--------------------------------------------------------------------------------
1 | [Commando.io](https://commando.io) A simpler way to manage servers online. Commando.io; your first DevOps hire!
2 |
3 | Install Notes
4 | -------------
5 |
6 | * **API token secret key** - A valid API token secret key. You may create API tokens on the settings page in the Commando.io web interface.
7 | * **Account alias** - Your account alias is simply the subdomain that you access Commando.io with. For example the account alias of `https://foo.commando.io` is `foo`.
8 | * **Recipe** - The recipe you wish to execute. You may find recipe ids in the in the Commando.io web interface.
9 | * **Server** - A single server id. You may find server ids in the modal popup when clicking a server in the Commando.io web interface.
10 | * **Groups** - A list of group ids separated by commas. You may find group ids in the modal popup when clicking a group in the Commando.io web interface.
11 | * **Notes** _(Optional)_ - Notes and comments you wish to attach to this execution. Markdown is supported.
12 | * **Halt on stderr** _(Optional)_ - If a server returns stderr during execution, halt and prevent the remaining servers from executing the recipe.
13 |
--------------------------------------------------------------------------------
/docs/gocd:
--------------------------------------------------------------------------------
1 | [Go](http://go.cd) (also GoCD) is a Continuous Integration (CI) and Continuous Delivery (CD) server.
2 |
3 | The GitHub GoCD service can be used to trigger builds when changes are pushed to the corresponding GitHub repository.
4 | This is a replacement for the polling method, where the Go server periodically polls the repositories for changes.
5 |
6 | Install Notes
7 | -------------
8 |
9 | 1. Your Go server must be accessible from the internet.
10 |
11 | 2. "base_url" (mandatory) is the URL to your Go server
12 | Example: https://go.example.com/ or http://go.example.com:8153
13 |
14 | 3. "repository_url" (mandatory) is the URL that is configured in the Materials section of the concerned pipelines.
15 | Example: git@github.com:gocd/gocd.git or git://github.com/gocd/gocd
16 |
17 | 4. "username" and "password" - username and password of a Go admin user that can
18 | trigger the Materials API endpoint. Can be left empty if the Go server has no authentication configured (not recommended.)
19 |
20 | 5. "verify_ssl" is used to enable (recommended) or disable certificate checking when using ssl.
21 | Disabling this can make the ssl connection insecure.
22 |
--------------------------------------------------------------------------------
/test/iron_worker_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class IronWorkerTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/v1/webhooks/github" do |env|
10 | form = Rack::Utils.parse_query(env[:body])
11 | p form
12 | assert_equal payload, JSON.parse(form['payload'])
13 | assert_equal 't', form['token']
14 | assert_equal '123', form['project_id']
15 | [200, {}, '']
16 | end
17 |
18 | token = 'x'
19 | project_id = '111122223333444455556666'
20 | code_name = 'fake_code_name'
21 | svc = service(
22 | {
23 | 'token' => token,
24 | 'project_id' => project_id,
25 | 'code_name' => code_name
26 | },
27 | payload)
28 | data, payload, resp = svc.receive_event
29 | assert_equal token, data['token']
30 | assert_equal project_id, data['project_id']
31 | assert_equal code_name, data['code_name']
32 | assert_equal 200, resp.code
33 | end
34 |
35 | def service(*args)
36 | super Service::IronWorker, *args
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/docs/autodeploy:
--------------------------------------------------------------------------------
1 | This service automatically creates deployments based on your [workflow](http://www.atmos.org/github-services/auto-deployment/).
2 |
3 | By enabling this hook, GitHub will request a [GitHub Deployment][1] when the default branch is pushed to or your tests suite passes certain criteria.
4 |
5 | If you use Continuous Integration and GitHub you can select to "Deploy on Status" which will only create deployments when the default branch receives a "success" status for a commit.
6 |
7 | Install Notes
8 | -------------
9 |
10 | 1. `github_token` A [personal access token](https://github.com/settings/applications) from GitHub with `repo_deployment` scope.
11 | 2. `environments` A comma delimited set of environment names to auto-deploy. e.g. production,staging.
12 | 3. `deploy_on_status`: If checked deployments will only be created when successful [commit statuses][2] are created by your continuous integration system.
13 | 4. `github_api_url` The URL for the GitHub API. Override this for enterprise. **Optional** e.g. `https://enterprise.myorg.com`.
14 |
15 | [1]: https://developer.github.com/v3/repos/deployments
16 | [2]: https://developer.github.com/v3/repos/statuses
17 |
--------------------------------------------------------------------------------
/docs/codeclimate:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | To set up this service hook, follow these steps:
5 |
6 | 1. Browse to your Code Climate [Dashboard](https://codeclimate.com/dashboard).
7 | 2. Click **Organization** in the top-right corner of the page. If this link isn't visible, see below.
8 | 3. Select the **Integrations** tab.
9 | 4. Copy the **GitHub Service Token** to your clipboard. Note that you do not want to copy the **API Token**.
10 | 5. Back in GitHub, paste the token into the text box below.
11 |
12 | ### Why don't I see the Organization link in Code Climate?
13 |
14 | Few possible reasons:
15 |
16 | * You're trying to set up a service hook for a repository that lives in the **Open Source** section of your **Dashboard**. Unfortunately we don't yet support service hooks for these repositories.
17 | * Your Code Climate user is not a member of any organizations.
18 | * You're in an organization but not in its **Owners** group. In this case, you unfortunately won't have administrative-rights to view this token.
19 |
20 | For more detailed info, see our [help article](http://docs.codeclimate.com/article/222-how-do-i-install-code-climates-github-service-hook).
21 |
--------------------------------------------------------------------------------
/docs/ibmdevopsservices:
--------------------------------------------------------------------------------
1 | This service replaces the Rational JazzHub service to integrate GitHub with IBM Bluemix DevOps Services (http://hub.jazz.net). The hook automatically adds change set links in the work item specified by the commit message.
2 |
3 | The hook will recognize any of the common work item type names in the commit message and look for a corresponding work item.
4 |
5 | For example:
6 | - "Fix bug 42"
7 | - "Deliver Story 99"
8 | - "[work item 999] fixed some stuff"
9 |
10 | Install Notes
11 | -------------
12 |
13 | The IBM Bluemix DevOps Services hook needs to be configured with your DevOps Services login info:
14 |
15 | 1. Ibm - The user ID that is used to access DevOps Services.
16 | 2. Ibm password - The password for the user ID that is used to access DevOps Services. If your organization uses federated authentication, you must use a personal access token. See [Setting up the GitHub hook](https://hub.jazz.net/docs/githubhooks/#github_hook) for details.
17 | 3. Project membership - The configured user needs to be a member of the DevOps Services project.
18 | 4. Override server url - The DevOps Services server url (for IBM internal testing only).
19 |
--------------------------------------------------------------------------------
/docs/trello:
--------------------------------------------------------------------------------
1 | Adds a card to a Trello list for each commit pushed to GitHub, optionally limited to the master branch or by exclusion regex.
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. [Create a consumer token][create] authorizing GitHub to write to the Trello API.
7 | 2. Supply the list identifier for the list to be added to. Pull requests can optionally be added to a separate Trello list. You can get the lists for a board at this URL:
8 | https://api.trello.com/1/board/BOARDID?token=TOKEN&key=db1e35883bfe8f8da1725a0d7d032a9c&lists=all
9 | (To edit this URL for your Trello board, replace 'TOKEN' with the consumer token you created in step 1, and BOARDID with the ID of the Trello board that the list is on – the ID is the final section of the board's Trello URL.)
10 | 3. If you want to ignore commits with commit messages matching a particular regular expression (i.e. "Merge branch"), put the regex here.
11 | 4. If you want to create cards only for commits on the master branch, tick "Master Only."
12 |
13 | [create]: https://trello.com/1/authorize?key=db1e35883bfe8f8da1725a0d7d032a9c&name=GitHub+Services&expiration=never&response_type=token&scope=read,write
14 |
--------------------------------------------------------------------------------
/docs/bamboo:
--------------------------------------------------------------------------------
1 | Bamboo is a continuous integration server that automates the building and testing of your software.
2 | The GitHub Bamboo service can be used to trigger builds after code has been pushed to your git repository.
3 |
4 | Install Notes
5 | -------------
6 |
7 | 1. Your Bamboo server must be accessible from the internet.
8 |
9 | 2. "base_url" is the URL to your Bamboo server
10 | Example: https://bamboo.example.com/ or http://bamboo.example.com/bamboo/
11 |
12 | 3. "build_key" is the identifier of the plan you want to trigger
13 | Example: "BAM-TRUNK", where BAM = project key, TRUNK = plan key
14 |
15 | A compound build key value can be used to specify multiple builds or associate
16 | specific branches with a build
17 | Example: "master:BAM-TRUNK,3-2-patches:BAM-32PATCH,BAM-TESTS", where BAM-TRUNK
18 | will be triggered only by pushes to the master branch, BAM-32PATCH will only
19 | be triggered by pushes to the 3-2-patches branch, and BAM-TESTS will be triggered
20 | for any push.
21 |
22 | 4. "username" and "password" - username and password of a Bamboo user that can
23 | trigger a manual build of the Bamboo plan defined in "build_key"
24 |
--------------------------------------------------------------------------------
/test/simperium_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class SimperiumTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 | test_app_id = "sample-app-name"
8 | test_token = "0123456789abcde"
9 | test_bucket = "github-event"
10 |
11 | data = {
12 | 'app_id' => test_app_id,
13 | 'token' => test_token,
14 | 'bucket' => test_bucket
15 | }
16 |
17 | payload = {'commits'=>[{'id'=>'test'}]}
18 | svc = service(data, payload)
19 |
20 | @stubs.post "/1/#{test_app_id}/#{test_bucket}/i/#{svc.delivery_guid}" do |env|
21 | body = JSON.parse(env[:body])
22 |
23 | assert_equal env[:url].host, "api.simperium.com"
24 | assert_equal env[:request_headers]['Authorization'], "Token #{test_token}"
25 | assert_equal 'test', body['payload']['commits'][0]['id']
26 | assert_match 'guid-', body['guid']
27 | assert_equal data, body['config']
28 | assert_equal 'push', body['event']
29 | [200, {}, '']
30 | end
31 |
32 | svc.receive_event
33 | @stubs.verify_stubbed_calls
34 | end
35 |
36 | def service_class
37 | Service::Simperium
38 | end
39 | end
40 |
41 |
--------------------------------------------------------------------------------
/lib/service/events/issue_comment_helpers.rb:
--------------------------------------------------------------------------------
1 | module Service::IssueCommentHelpers
2 | include Service::HelpersWithMeta,
3 | Service::HelpersWithActions
4 |
5 | def issue
6 | @issue ||= self.class.objectify(payload['issue'])
7 | end
8 |
9 | def comment
10 | @comment ||= self.class.objectify(payload['comment'])
11 | end
12 |
13 | def summary_url
14 | comment.html_url
15 | end
16 |
17 | def summary_message
18 | "[%s] %s comment on issue #%d: %s. %s" % [
19 | repo.name,
20 | sender.login,
21 | issue.number,
22 | comment.body,
23 | comment.html_url
24 | ]
25 | rescue
26 | raise_config_error "Unable to build message: #{$!.to_s}"
27 | end
28 |
29 | def self.sample_payload
30 | Service::HelpersWithMeta.sample_payload.merge(
31 | "action" => "created",
32 | "issue" => {
33 | "number" => 5,
34 | "state" => "open",
35 | "title" => "booya",
36 | "body" => "boom town",
37 | "user" => { "login" => "mojombo" }
38 | },
39 | "comment" => {
40 | "user" => { "login" => "defunkt" },
41 | "body" => "this\r\nis\r\ntest comment"
42 | }
43 | )
44 | end
45 | end
46 |
--------------------------------------------------------------------------------
/lib/services/packagist.rb:
--------------------------------------------------------------------------------
1 | class Service::Packagist < Service
2 | string :user
3 | password :token
4 | string :domain
5 | white_list :domain, :user
6 |
7 | def receive_push
8 | http_post packagist_url, :payload => generate_json(payload), :username => user, :apiToken => token
9 | end
10 |
11 | def packagist_url
12 | "#{scheme}://#{domain}/api/github"
13 | end
14 |
15 | def user
16 | if data['user'].to_s == ''
17 | payload['repository']['owner']['name']
18 | else
19 | data['user']
20 | end.strip
21 | end
22 |
23 | def token
24 | if data['token'].to_s == ''
25 | ''
26 | else
27 | data['token'].strip
28 | end
29 | end
30 |
31 | def scheme
32 | domain_parts.size == 1 ? 'http' : domain_parts.first
33 | end
34 |
35 | def domain
36 | domain_parts.last
37 | end
38 |
39 | protected
40 |
41 | def full_domain
42 | if data['domain'].to_s == ''
43 | 'https://packagist.org'
44 | else
45 | data['domain'].lstrip.sub(/[\/\s]+\z/,'').sub(/\Ahttp:\/\/packagist.org/, 'https://packagist.org')
46 | end
47 | end
48 |
49 | def domain_parts
50 | @domain_parts ||= full_domain.split('://')
51 | end
52 | end
53 |
--------------------------------------------------------------------------------
/lib/services/appharbor.rb:
--------------------------------------------------------------------------------
1 | class Service::AppHarbor < Service
2 | string :application_slug
3 | password :token
4 | white_list :application_slug
5 |
6 | def receive_push
7 | slugs = data['application_slug']
8 | token = data['token']
9 |
10 | raise_config_error 'Missing application slug' if slugs.to_s.empty?
11 | raise_config_error 'Missing token' if token.to_s.empty?
12 |
13 | slugs.split(",").each do |slug|
14 | slug.strip!
15 | post_appharbor_message(slug, token)
16 | end
17 | end
18 |
19 | private
20 |
21 | def post_appharbor_message(slug, token)
22 | return unless commit = distinct_commits.last
23 | create_build_url = "https://appharbor.com/applications/#{slug}/builds"
24 |
25 | appharbor_message = {
26 | :branches => {
27 | ref_name => {
28 | :commit_id => commit['id'],
29 | :commit_message => commit['message'],
30 | :download_url => commit['url'].sub('commit', 'tarball')
31 | }
32 | }
33 | }
34 |
35 | http.headers['Accept'] = 'application/json'
36 | http.headers['Authorization'] = "BEARER #{token}"
37 |
38 | http_post create_build_url, generate_json(appharbor_message)
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/test/jenkins_git_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class JenkinsGitTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | @options = {'jenkins_url' => 'http://monkey:secret@jenkins.example.com/jenkins/'}
7 | end
8 |
9 | def test_push
10 | @stubs.get "/jenkins/git/notifyCommit" do |env|
11 | assert_equal 'jenkins.example.com', env[:url].host
12 |
13 | assert_equal 'Basic bW9ua2V5OnNlY3JldA==', env[:request_headers]['authorization']
14 |
15 | params = Faraday::Utils.parse_nested_query(env[:url].query)
16 | expected_params = {
17 | 'url' => 'http://github.com/mojombo/grit',
18 | 'branches' => 'master',
19 | 'from' => 'github'
20 | }
21 | assert_equal(expected_params, params)
22 |
23 | [200, {}, '']
24 | end
25 |
26 | service(@options, payload).receive_push
27 |
28 | @stubs.verify_stubbed_calls
29 | end
30 |
31 | def test_no_jenkins_hook_url
32 | assert_raises Service::ConfigurationError do
33 | service({'jenkins_url' => ''}, payload).receive_push
34 | end
35 | end
36 |
37 | def service(*args)
38 | super Service::JenkinsGit, *args
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/test/deploy_hq_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class DeployHqTest < Service::TestCase
4 |
5 | def setup
6 | @stubs = Faraday::Adapter::Test::Stubs.new
7 | end
8 |
9 | def test_push
10 | @stubs.post '/deploy/projectname/to/servername/serverkey' do |env|
11 | assert_equal 'test.deployhq.com', env[:url].host
12 | assert_equal 'https', env[:url].scheme
13 | post_payload = JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
14 |
15 | refute_nil payload['after']
16 | assert_equal post_payload['after'], post_payload['after']
17 | refute_nil post_payload['ref']
18 | assert_equal payload['ref'], post_payload['ref']
19 | refute_nil post_payload['repository']['url']
20 | assert_equal payload['repository']['url'], post_payload['repository']['url']
21 | assert_equal payload['pusher']['email'], post_payload['pusher']['email']
22 |
23 | [201, [], '']
24 | end
25 |
26 | svc = service :push, { 'deploy_hook_url' => 'https://test.deployhq.com/deploy/projectname/to/servername/serverkey' }, payload
27 | svc.receive_push
28 | end
29 |
30 | def service(*args)
31 | super Service::DeployHq, *args
32 | end
33 |
34 | end
35 |
--------------------------------------------------------------------------------
/docs/mqttpub:
--------------------------------------------------------------------------------
1 | This service lets you publish push and commit messages to a message broker via the MQTT protocol.
2 |
3 | Install Notes
4 | -------------
5 |
6 | 1. OPTIONAL. 'broker' is the hostname of the MQTT broker (default is q.m2m.io).
7 | 2. OPTIONAL. 'port' is the port to connect (default is 1883, MQTT standard).
8 | 3. 'topic' is the name of the topic to publish on. Suggested example: 'github/{github_username}/{repo_name} .
9 | 4. OPTIONAL. 'clientid' is the unique client ID which publishes the payload message (default is a prefixed epoc time long, e.g. "github_1336363787").
10 | 5. OPTIONAL. 'user' is the v3.1 username (default is none).
11 | 6. OPTIONAL. 'pass' is the v3.1 password (default is none).
12 | 7. OPTIONAL. 'retain' specifies whether or not the publication should be retained as the last/most recent message for new subscribers.
13 | 8. The payload of the message is JSON received from GitHub (refer to docs/github_payload).
14 | 9. ruby-mqtt only supports QoS 0.
15 | 10. For testing, you can use mqtt.io as your web MQTT client. broker: q.m2m.io, port: 1883, clientid: {github_username}. You will "Subscribe to Topics": 'github/{github_username}/{repo_name}'. Unauthenticated username/password sets default to the public channel!
16 |
17 |
--------------------------------------------------------------------------------
/lib/services/statusnet.rb:
--------------------------------------------------------------------------------
1 | class Service::StatusNet < Service
2 | string :server, :username
3 | password :password
4 | boolean :digest
5 | white_list :server, :username
6 |
7 | def receive_push
8 | repository = payload['repository']['name']
9 | statuses = Array.new
10 |
11 | if config_boolean_true?('digest')
12 | commit = payload['commits'][-1]
13 | tiny_url = shorten_url("#{payload['repository']['url']}/commits/#{ref_name}")
14 | statuses.push "[#{repository}] #{tiny_url} #{commit['author']['name']} - #{payload['commits'].length} commits"
15 | else
16 | payload['commits'].each do |commit|
17 | tiny_url = shorten_url(commit['url'])
18 | statuses.push "[#{repository}] #{tiny_url} #{commit['author']['name']} - #{commit['message']}"
19 | end
20 | end
21 |
22 | http.ssl[:verify] = false
23 | http.url_prefix = data['server']
24 | http.basic_auth(data['username'], data['password'])
25 | statuses.each do |status|
26 | http_post '/api/statuses/update.xml',
27 | 'status' => status, 'source' => 'github'
28 | end
29 | rescue Faraday::Error::ConnectionFailed
30 | raise_config_error "Connection refused. Invalid server configuration."
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/docs/codeship:
--------------------------------------------------------------------------------
1 | Codeship offers continuous integration and deployment for a variety of applications including Ruby, Node, PHP, Python, Java and Go.
2 |
3 | This service hook will inform Codeship every time you push to GitHub. On every push Codeship tests the current version of your application. If all tests succeed, Codeship can also deploy your application, otherwise it informs you about the failures.
4 |
5 | Install Notes
6 | -------------
7 |
8 | Codeship will install this hook automatically on sign up. However, if creating the service didn't succeed or you accidentally deleted it, you can also install it manually.
9 |
10 | 1. Sign up at [codeship.com](https://codeship.com)
11 | 2. Go to your project's settings, find the General section and copy the project UUID
12 | 3. Paste the project UUID into the text field below
13 | 4. Make sure the "Active" checkbox is ticked and click "Update service"
14 | 5. Click on the "Codeship" service name and then click "Test service"
15 | 6. Now there should be a running build on your Codeship dashboard
16 |
17 | Learn more by visiting [codeship.com](https://codeship.com) and our [documentation](https://documentation.codeship.com).
18 |
19 | [Contact us](https://helpdesk.codeship.com) if you need further assistance.
20 |
--------------------------------------------------------------------------------
/lib/services/firebase.rb:
--------------------------------------------------------------------------------
1 | class Service::Firebase < Service
2 | string :firebase, :secret
3 | white_list :firebase
4 |
5 | url 'https://www.firebase.com'
6 | logo_url 'https://www.firebase.com/images/logo.png'
7 | maintained_by :github => 'anantn'
8 | supported_by :email => 'support@firebase.com'
9 |
10 | def receive_push
11 | url = data['firebase'].to_s
12 | url.gsub! /\s/, ''
13 |
14 | if url.empty?
15 | raise_config_error 'Invalid URL.'
16 | end
17 |
18 | if url !~ /^https\:\/\//
19 | raise_config_error 'Invalid URL (did you include the https prefix?)'
20 | end
21 |
22 | if url !~ /^.*\.json$/
23 | url = url + '.json'
24 | end
25 |
26 | secret = data['secret'].to_s
27 | if secret.length > 0
28 | url = url + '?auth=' + secret
29 | end
30 |
31 | payload['commits'].each do |commit|
32 | http_post url, generate_json(commit)
33 | end
34 | rescue Addressable::URI::InvalidURIError, Errno::EHOSTUNREACH
35 | raise_missing_error $!.to_s
36 | rescue SocketError
37 | if $!.to_s =~ /getaddrinfo:/
38 | raise_missing_error 'Invalid host name.'
39 | else
40 | raise
41 | end
42 | rescue EOFError
43 | raise_config_error 'Invalid server response.'
44 | end
45 | end
46 |
--------------------------------------------------------------------------------
/lib/services/web.rb:
--------------------------------------------------------------------------------
1 | class Service::Web < Service
2 | include HttpHelper
3 |
4 | string :url,
5 | # old hooks send form params ?payload=JSON(...)
6 | # new hooks should set content_type == 'json'
7 | :content_type
8 |
9 | # adds a X-Hub-Signature of the body content
10 | # X-Hub-Signature: sha1=....
11 | password :secret
12 |
13 | white_list :url, :content_type
14 |
15 | boolean :insecure_ssl # :(
16 |
17 | def receive_event
18 | http.headers['X-GitHub-Event'] = event.to_s
19 | http.headers['X-GitHub-Delivery'] = delivery_guid.to_s
20 |
21 | res = deliver data['url'],
22 | :content_type => data['content_type'],
23 | :insecure_ssl => config_boolean_true?('insecure_ssl'),
24 | :secret => data['secret']
25 |
26 | if res.status < 200 || res.status > 299
27 | raise_config_error "Invalid HTTP Response: #{res.status}"
28 | end
29 | end
30 |
31 | def original_body
32 | payload
33 | end
34 |
35 | def default_encode_body
36 | encode_body_as_form
37 | end
38 |
39 | def encode_body_as_form
40 | http.headers['content-type'] = 'application/x-www-form-urlencoded'
41 | Faraday::Utils.build_nested_query(
42 | http.params.merge(:payload => generate_json(original_body)))
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/docs/docker:
--------------------------------------------------------------------------------
1 | When enabled this will let the Docker Hub know when you have made changes to
2 | your repository. The Docker Hub will then pull down your repository and build
3 | your Dockerfile to create a Docker repository and push it onto the Docker Hub
4 | so that it is available for others to download. When you commit changes to your
5 | git Repo the Docker Hub will keep the Docker Repository up to date.
6 |
7 | #### Note:
8 |
9 | Docker has two types of repositories, public and private. A public repository
10 | is able to be downloaded by anyone. The private repository can only be
11 | downloaded by someone whom the owner has given explicit access too.
12 |
13 | When creating an automated build from a private GitHub repo, it is recommended
14 | that you only use a private Docker repo. If you have a private GitHub
15 | repository and you are building into a public Docker repository, you might be
16 | accidentally exposing data you don't intend to expose.
17 |
18 | #### Requirements:
19 |
20 | In order for this to work correctly, you should have the following:
21 |
22 | 1. A [Docker Hub](https://hub.docker.com "Docker Hub")
23 | Account, that is linked to your GitHub account.
24 | 2. A [Dockerfile](https://docs.docker.com/reference/builder/ "Dockerfile")
25 | in your project directory.
26 |
--------------------------------------------------------------------------------
/lib/services/apropos.rb:
--------------------------------------------------------------------------------
1 |
2 | class Service::Apropos < Service::HttpPost
3 | default_events :commit_comment, :issues, :issue_comment, :pull_request, :push
4 | string :project_id
5 |
6 | def apropos_url
7 | proj_id = appid = required_config_value('project_id')
8 | "http://www.apropos.io/api/v1/githook/#{proj_id}"
9 | end
10 |
11 | def receive_commit_comment
12 | http.headers['content-type'] = 'application/json'
13 | http.headers['X-Github-Event'] = 'commit_comment'
14 | deliver apropos_url
15 | end
16 |
17 | def receive_issue_comment
18 | http.headers['content-type'] = 'application/json'
19 | http.headers['X-Github-Event'] = 'issue_comment'
20 | deliver apropos_url
21 | end
22 |
23 | def receive_pull_request
24 | http.headers['content-type'] = 'application/json'
25 | http.headers['X-Github-Event'] = 'pull_request'
26 | deliver apropos_url
27 | end
28 |
29 | def receive_issues
30 | http.headers['content-type'] = 'application/json'
31 | http.headers['X-Github-Event'] = 'issues'
32 | deliver apropos_url
33 | end
34 |
35 | def receive_push
36 | http.headers['content-type'] = 'application/json'
37 | http.headers['X-Github-Event'] = 'push'
38 | deliver apropos_url
39 | end
40 |
41 | end
42 |
--------------------------------------------------------------------------------
/docs/jenkinsgit:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | * Requires **[Git Plugin][wiki] v1.1.18**, released 2012-04-27, and the "Poll SCM"
5 | build trigger needs to be enabled. (Though you can have it poll very
6 | infrequently, I recommend something like `0 */3 * * *`)
7 | * "Jenkins Url" is the base URL of your [Jenkins][] server. For example:
8 | `http://ci.jenkins-ci.org/`. We will hit `/git/notifyCommit` under this URL. (See
9 | [the Git plugin wiki page][wiki-push] for more details.)
10 |
11 | Details
12 | -------
13 |
14 | [Jenkins][] is a popular continuous integration server.
15 |
16 | If you're using the standard [Jenkins Git plugin][wiki] to poll & check out
17 | your repository, you can quickly and easily switch to a push model using this
18 | service.
19 |
20 | It will send a request to your Jenkins instance telling it about the
21 | repositories and branches that changed. Jenkins will then poll the repository
22 | and build if needed. See [push notification from repository][wiki-push] on the
23 | Jenkins wiki for information.
24 |
25 | [jenkins]: http://jenkins-ci.org/ "Jenkins CI Server"
26 | [wiki]: https://wiki.jenkins-ci.org/display/JENKINS/Git+plugin
27 | [wiki-push]: https://wiki.jenkins-ci.org/display/JENKINS/Git+plugin#GitPlugin-Pushnotificationfromrepository
28 |
29 |
--------------------------------------------------------------------------------
/test/active_collab_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class ActiveCollabTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/foo" do |env|
10 | query = Faraday::Utils.parse_nested_query(env[:url].query)
11 | body = Faraday::Utils.parse_nested_query(env[:body])
12 | assert_equal '2', body['discussion']['milestone_id']
13 | assert_equal '3', body['discussion']['parent_id']
14 | assert_equal 'activecollab.com', env[:url].host
15 | assert_equal "projects/1/discussions/add", query['path_info']
16 | assert_equal "token", query["token"]
17 | assert_equal 'application/xml', env[:request_headers]["Accept"]
18 | assert_match /grit/, env[:body]
19 | [200, {}, '{}']
20 | end
21 |
22 | svc = service({
23 | 'url' => 'http://activecollab.com/foo',
24 | 'token' => 'token',
25 | 'project_id' => '1',
26 | 'milestone_id' => '2',
27 | 'category_id' => '3'
28 | }, payload)
29 |
30 | def svc.shorten_url(*args)
31 | 'short'
32 | end
33 |
34 | svc.receive_push
35 | end
36 |
37 | def service(*args)
38 | super Service::ActiveCollab, *args
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/test/codeclimate_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class CodeClimateTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | @svc = service(data, {'commits'=>[{'id'=>'test'}]})
7 | end
8 |
9 | def test_reads_token_from_data
10 | assert_equal "5373dd4a3648b88fa9acb8e46ebc188a", @svc.token
11 | end
12 |
13 | def test_strips_whitespace_from_token
14 | svc = service({'token' => '5373dd4a3648b88fa9acb8e46ebc188a '}, payload)
15 | assert_equal '5373dd4a3648b88fa9acb8e46ebc188a', svc.token
16 | end
17 |
18 | def test_posts_payload
19 | @stubs.post '/github_events' do |env|
20 | assert_equal 'https', env[:url].scheme
21 | assert_equal 'codeclimate.com', env[:url].host
22 | assert_equal basic_auth('github', '5373dd4a3648b88fa9acb8e46ebc188a'),
23 | env[:request_headers]['authorization']
24 | assert JSON.parse(env[:body]).keys.include?("payload")
25 | assert_equal "test", JSON.parse(env[:body])["payload"]["commits"][0]["id"]
26 | end
27 |
28 | @svc.receive_event
29 | end
30 |
31 | private
32 |
33 | def service(*args)
34 | super Service::CodeClimate, *args
35 | end
36 |
37 | def data
38 | { 'token' => '5373dd4a3648b88fa9acb8e46ebc188a' }
39 | end
40 |
41 | end
42 |
--------------------------------------------------------------------------------
/test/commandoio_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class Commandoio < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "v1/recipes/_______mock_recipe_______/execute" do |env|
10 | body = Faraday::Utils.parse_query(env[:body])
11 | payload = JSON.parse(body['payload'])
12 |
13 | assert_equal 'api.commando.io', env[:url].host
14 | assert_equal 'https', env[:url].scheme
15 | assert_match 'application/x-www-form-urlencoded', env[:request_headers]['content-type']
16 | assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
17 | assert_equal basic_auth('demo', 'skey_abcdsupersecretkey'),
18 | env[:request_headers]['authorization']
19 | [200, {}, '']
20 | end
21 |
22 | svc = service :push, {
23 | 'api_token_secret_key' => 'skey_abcdsupersecretkey',
24 | 'account_alias' => 'demo',
25 | 'recipe' => '_______mock_recipe_______',
26 | 'server' => '_server_',
27 | 'notes' => 'Test the mock recipe!'
28 | }
29 | svc.receive_event
30 | end
31 |
32 | def service(*args)
33 | super Service::Commandoio, *args
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/test/sifter_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class SifterTest < Service::TestCase
4 |
5 | def setup
6 | @stubs = Faraday::Adapter::Test::Stubs.new
7 | @svc = service(data, payload)
8 | end
9 |
10 | def test_reads_token
11 | assert_equal token, @svc.token
12 | end
13 |
14 | def test_reads_subdomain
15 | assert_equal 'example', @svc.subdomain
16 | end
17 |
18 | def test_implies_host
19 | assert_equal "https://example.sifterapp.com/api/github", @svc.hook_url
20 |
21 | ENV['SIFTER_HOST'] = 'sifter.dev'
22 | assert_equal "http://example.sifter.dev/api/github", @svc.hook_url
23 | ENV.delete('SIFTER_HOST')
24 | end
25 |
26 | def test_posts_payload
27 | @stubs.post '/api/github' do |env|
28 | assert_equal 'https', env[:url].scheme
29 | assert_equal 'example.sifterapp.com', env[:url].host
30 | assert_equal token, env[:params]['token']
31 | assert_equal payload, JSON.parse(env[:body])
32 | end
33 |
34 | @svc.receive_push
35 | end
36 |
37 | private
38 |
39 | def service(*args)
40 | super Service::Sifter, *args
41 | end
42 |
43 | def data
44 | {'token' => token + ' ' * 4, 'subdomain' => 'example'}
45 | end
46 |
47 | def token
48 | 'NTpuZXh0dXckYX4lOjE%3D'
49 | end
50 |
51 | end
52 |
--------------------------------------------------------------------------------
/lib/services/talker.rb:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 | class Service::Talker < Service
3 | string :url
4 | password :token
5 | boolean :digest
6 | white_list :url
7 |
8 | def receive_push
9 | repository = payload['repository']['name']
10 | branch = branch_name
11 | commits = payload['commits']
12 |
13 | prepare_http
14 |
15 | say "#{summary_message} – #{summary_url}"
16 | if config_boolean_false?('digest')
17 | if distinct_commits.size == 1
18 | commit = distinct_commits.first
19 | say format_commit_message(commit)
20 | else
21 | distinct_commits.each do |commit|
22 | say "#{format_commit_message(commit)} – #{commit['url']}"
23 | end
24 | end
25 | end
26 | end
27 |
28 | def receive_pull_request
29 | return unless opened?
30 |
31 | prepare_http
32 | say "#{summary_message}. #{summary_url}"
33 | end
34 |
35 | def receive_issues
36 | return unless opened?
37 |
38 | prepare_http
39 | say summary_message
40 | end
41 |
42 | private
43 | def prepare_http
44 | http.ssl[:verify] = false
45 | http.headers["X-Talker-Token"] = data['token']
46 | http.url_prefix = data['url']
47 | end
48 |
49 | def say(message)
50 | http_post 'messages.json', :message => message
51 | end
52 | end
53 |
--------------------------------------------------------------------------------
/docs/maxcdn:
--------------------------------------------------------------------------------
1 | Purge your MaxCDN Pull Zone
2 | ---------------------------
3 |
4 | **Setup Notes**
5 |
6 | 1. Get your "Company Alias", "Consumer Key" and "Consumer Secret" from your [MaxCDN Account API Page][account_api_url].
7 | 2. Get your "Zone ID" from your [MaxCDN Account Pull Zones Overview page][account_pull_zone].
8 | 3. "Static Only" will only purge your zone if modified files include static files — `css`, `js`, `jpg`, `jpeg`, `gif`, `ico`, `png`, `bmp`, `pict`, `csv`, `doc`, `pdf`, `pls`, `ppt`, `tif`, `tiff`, `eps`, `ejs`, `swf`, `midi`, `mid`, `txt`, `ttf`, `eot`, `woff`, `otf`, `svg`, `svgz`, `webp`, `docx`, `xlsx`, `xls`, `pptx`, `ps`, `rss`, `class`, `jar`.
9 | 4. Whitelist the GitHub web hook IP block with MaxCDN. For instructions, see MaxCDN's support page on [How To Whitelist Your Server IP To Use The API][whitelist_article].
10 |
11 | > GitHub's IPs may change from time to time, if you're having issues, verify that the IP you've whitelisted is still current, by checking the "hook" key at [GitHub's "meta" API endpoint][meta_endpoint].
12 |
13 | [account_api_url]: https://cp.maxcdn.com/account/api
14 | [account_pull_zone]: https://cp.maxcdn.com/zones/pull
15 | [whitelist_article]: http://support.maxcdn.com/tutorials/how-to-whitelist-your-server-ip-to-use-the-api/
16 | [meta_endpoint]: https://api.github.com/meta
17 |
--------------------------------------------------------------------------------
/lib/services/deployervc.rb:
--------------------------------------------------------------------------------
1 | require 'uri'
2 |
3 | class Service::Deployervc < Service::HttpPost
4 | string :deployment_address
5 | password :api_token
6 |
7 | white_list :deployment_address
8 |
9 | default_events :push
10 |
11 | url "https://deployer.vc"
12 |
13 | maintained_by :github => 'deployervc-emre'
14 |
15 | supported_by :web => 'https://deployer.vc/support.html',
16 | :email => 'support@deployer.vc'
17 |
18 |
19 | def receive_event
20 | deploymentaddress = required_config_value('deployment_address')
21 | apitoken = required_config_value('api_token')
22 |
23 | begin
24 | URI.parse(deploymentaddress)
25 | rescue URI::InvalidURIError
26 | raise_config_error("Invalid URL for deployment address: #{deploymentaddress}")
27 | end
28 |
29 | parts = URI.split(deploymentaddress)
30 | scheme = parts[0]
31 | host = parts[2]
32 | path = parts.last
33 | deployment_id = path.split('/').last
34 |
35 | http.headers['X-Deployervc-Token'] = apitoken
36 | http.headers['Content-Type'] = 'application/json'
37 | http.headers['Accept'] = 'application/json'
38 |
39 | http.url_prefix = "#{scheme}://#{host}"
40 |
41 | url = "/api/v1/deployments/deploy/#{deployment_id}"
42 | http_post(url, generate_json({:revision => ''}))
43 | end
44 | end
--------------------------------------------------------------------------------
/test/ontime_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 | require 'cgi'
3 |
4 | class OnTimeTest < Service::TestCase
5 | def setup
6 | @stubs = Faraday::Adapter::Test::Stubs.new
7 | end
8 |
9 | # This tests the old api paths of OnTime. Where 11.1.0 <= Version < 12.2.0
10 | def test_push
11 | @stubs.get "/api/version" do |env|
12 | assert_equal 'www.example.com', env[:url].host
13 | [200, {}, '{"data":{"major":12,"minor":0,"build":2}}']
14 | end
15 |
16 | @stubs.post "/api/github" do |env|
17 | [200, {}, '']
18 | end
19 |
20 | svc = service({'ontime_url' => 'http://www.example.com/', 'api_key' => 'test_api_key'}, payload)
21 | svc.receive_push
22 | end
23 |
24 | # This tests the new api path for GitHub in OnTime Version 12.2 and later.
25 | def test_push_v1_api
26 | @stubs.get "/v122/api/version" do |env|
27 | assert_equal 'www.example.com', env[:url].host
28 | [200, {}, '{"data":{"major":12,"minor":2,"build":0}}']
29 | end
30 |
31 | @stubs.post "/v122/api/v1/github" do |env|
32 | [200, {}, '']
33 | end
34 |
35 | svc = service({'ontime_url' => 'http://www.example.com/v122', 'api_key' => 'test_v1_api_key'}, payload)
36 | svc.receive_push
37 | end
38 |
39 | def service(*args)
40 | super Service::OnTime, *args
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/docs/crocagile:
--------------------------------------------------------------------------------
1 | Crocagile is an agile-inspired workspace that keeps your team together
2 | throughout the entire product life-cycle. Learn more at https://www.crocagile.com
3 |
4 | GitHub integration supports progress updates and time logging for tasks via
5 | commit message using "Updates" and "Time" triggers. Samples below.
6 |
7 |
8 | INSTALLATION
9 | =============
10 |
11 | 1. Obtain your Project Key from the settings area of your Crocagile project.
12 | 2. Save your project key to the Crocagile Service in your repository.
13 | 3. Use commit messages to update tasks. (See samples).
14 | 4. Visit https://blog.crocagile.com for friendly documentation.
15 |
16 |
17 | SAMPLES
18 | =============
19 |
20 | Update a task to 60% complete.
21 | -m " Your commit message. Updates T2355=60"
22 |
23 | Update two tasks at once. (No spaces between tasks)
24 | -m " Your commit message. Updates T2355=60,T2660=90"
25 |
26 | Mark a task complete and log time in hours (supports float).
27 | -m " Your commit message. Updates T2355=100 Time T2355=2.5"
28 |
29 | Update multiple progress+time (Spaces permitted between triggers, Not between tasks)
30 | -m "Your commit message. Updates T2355=100,T1039=75 Time T2355=2,T1039=1.5"
31 |
32 | Notes:
33 | "Update T2355" is identical to "Update T2355=100"
34 | "Time T2355" is identical to "Time T2355=1"
35 | Don't forget the "T" !
36 |
--------------------------------------------------------------------------------
/test/windowsazure_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../helper", __FILE__)
2 |
3 | class WindowsAzureTest < Service::TestCase
4 | include Service::HttpTestMethods
5 |
6 | def test_push
7 |
8 | data = {
9 | "hostname" => "test.scm.azurewebsites.net",
10 | "username" => "test_user",
11 | "password" => "test_pwd"
12 | }
13 |
14 | svc = service(data, payload)
15 |
16 | @stubs.post "/deploy?scmType=GitHub" do |env|
17 | assert_equal 'push', env[:request_headers]['x-github-event']
18 | assert_equal 'Basic dGVzdF91c2VyOnRlc3RfcHdk', env[:request_headers]['authorization']
19 | assert_equal env[:url].host, data['hostname']
20 | assert_match /form/, env[:request_headers]['content-type']
21 | params = Faraday::Utils.parse_nested_query(env[:url].query)
22 | assert_equal({'scmType' => 'GitHub'}, params)
23 | body = Faraday::Utils.parse_nested_query(env[:body])
24 | assert_equal 'GitHub', body['scmType']
25 | recv = JSON.parse(body['payload'])
26 | assert_equal payload, recv
27 | assert_nil env[:request_headers]['X-Hub-Signature']
28 | assert_equal 'GitHub', body['scmType']
29 | [200, {}, ""]
30 | end
31 |
32 | svc.receive_event
33 | end
34 |
35 | def service_class
36 | Service::WindowsAzure
37 | end
38 |
39 | end
40 |
41 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
4 |
5 | This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this.
6 |
7 | **NOTE**: GitHub no longer accepts new services. If you'd like to integrate
8 | your application or service with GitHub, you should use [webhooks][webhooks] which will `POST` a payload to your server for each event or request to join the [GitHub Marketplace][github-marketplace].
9 |
10 | ## Updating an existing service
11 |
12 | GitHub will only accept pull requests to existing services that implement bug fixes or security improvements. We no longer accept feature changes to existing services.
13 |
14 | All pull requests will be reviewed by multiple GitHub staff members before being merged. To allow ample time for review, testing and deployment, there may be a substantial delay between the pull request being created and the pull request being merged by GitHub's staff.
15 |
16 | [code-of-conduct]: http://todogroup.org/opencodeofconduct/#GitHub%20Services/opensource@github.com
17 | [webhooks]: https://developer.github.com/webhooks/
18 | [github-marketplace]: https://github.com/marketplace
19 |
--------------------------------------------------------------------------------
/test/pushbullet_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class PushbulletTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 |
7 | @options = {
8 | "api_key" => "e4f235a3851g396d801772b504898140",
9 | "device_iden" => "udhfWdjz4gRNO0Aq"
10 | }
11 | end
12 |
13 | def test_push
14 | stub_request "push"
15 | service(:push, @options, payload).receive_event
16 | end
17 |
18 | def test_push_no_device_iden
19 | @options["device_iden"] = ""
20 | stub_request "push"
21 | service(:push, @options, payload).receive_event
22 | end
23 |
24 | def test_issue
25 | stub_request "issues"
26 | service(:issues, @options, issues_payload).receive_event
27 | end
28 |
29 | def test_pull_request
30 | stub_request "pull_request"
31 | service(:pull_request, @options, pull_payload).receive_event
32 | end
33 |
34 | def stub_request(event)
35 | @stubs.post "/github" do |env|
36 | assert_equal 'https', env[:url].scheme
37 | assert_equal "webhook.pushbullet.com", env[:url].host
38 | body = JSON.parse(env[:body])
39 | assert_equal event, body['event']
40 | assert_equal @options, body['config']
41 | [200, {}, '']
42 | end
43 | end
44 |
45 | def service(*args)
46 | super(Service::Pushbullet, *args)
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/docs/amazonsns:
--------------------------------------------------------------------------------
1 | This service lets you publish event messages to Amazon's Simple Notification Service. Please note that SNS Topics are region specific.
2 |
3 | The AWS Key and Secret you provide can either be from your master account (not recommended) or from an IAM Resource.
4 |
5 | If using IAM, be sure to check that the user has the correct policies for publishing to the specified SNS Topic. A policy similar to the one below will provide your IAM Resource with the correct permission level.
6 |
7 | ```
8 | {
9 | "Version": "2012-10-17",
10 | "Statement": [
11 | {
12 | "Action": [
13 | "sns:Publish"
14 | ],
15 | "Sid": "Stmt0000000000000",
16 | "Resource": [
17 | "arn:aws:sns:us-east-1:718656560584:app-deploy"
18 | ],
19 | "Effect": "Allow"
20 | }
21 | ]
22 | }
23 | ```
24 |
25 | This service will attempt to provide you with meaningful errors if your configuration is incorrect.
26 |
27 | 1. 'aws_key' (Required) The access key to an Amazon Account or IAM User.
28 |
29 | 2. 'aws_secret' (Required) The Amazon secret access key associated with the AWS Key.
30 |
31 | 3. 'sns_topic' (Required) Full ARN path to the SNS Topic, ie. `arn:aws:sns:eu-west-1:718656560584:sns_topic_name`
32 |
33 | 4. 'sns_region' (Optional) the identifier for the AWS Region that the SNS Topic is located in. This defaults to `us-east-1`.
34 |
35 |
--------------------------------------------------------------------------------
/docs/targetprocess:
--------------------------------------------------------------------------------
1 | Integration with TargetProcess allows GitHub user to change current entity states
2 | and add comments directly from their commit messages.
3 |
4 |
5 | Install Notes
6 | --------------
7 |
8 | 1. TargetProcess Requirements
9 |
10 | - Requires TargetProcess version 2.22.4.19887 or newer.
11 |
12 | - Your TargetProcess must should be accessible from the internet.
13 |
14 | - Committer's email addresses in GitHub and TargetProcess should be the same.
15 |
16 | 2. Settings in GitHub
17 |
18 | In the GitHub integration config, the following settings should be provided:
19 |
20 | - TargetProcess Server URL
21 |
22 | - A project admin's account credentials to access your TargetProcess server.
23 |
24 |
25 | Commit Message Syntax
26 | ---------------------
27 |
28 | General comment format for adding comments and/or changing entity states:
29 |
30 |
31 | (#|id:)[Entity ID]:
32 | Eg: Fixed out of memory exceptions #1221:Fixed
33 | id:1221:Fixed Fixed out of memory exceptions
34 |
35 |
36 | The entire line will appear as a comment in your User Story, Bug, Feature, or Task; and the entity's
37 | state will be changed to the state name, if specified. A new state is not required, and an
38 | Assignable's state will not change unless it is specified. Entity ID is required. This
39 | text sequence can appear anywhere in your commit message.
40 |
--------------------------------------------------------------------------------
/docs/humbug:
--------------------------------------------------------------------------------
1 | Install Notes
2 | -------------
3 |
4 | Zulip is a group communication tool.
5 |
6 | https://zulip.com/hello
7 |
8 | Configuration Fields
9 | --------------------
10 |
11 | 1. **Email** - The user to authenticate as.
12 | 2. **Api Key** - The API key associated with the provided user. See: https://zulip.com/#settings
13 | 3. **Stream** - The default Zulip stream where event notifications will be sent. Defaults to "commits" if left empty. The stream (or the "commits" stream if empty) must exist in Zulip.
14 | 4. **Commit Stream** - Overrides **Stream** for Git commit notifications. The stream must exist in Zulip.
15 | 5. **Issue Stream** - Overrides **Stream** for GitHub issues notifications. The stream must exist in Zulip.
16 | 6. **Branches** - A comma-delimited whitelist of branches to receive event notifications about (e.g., "master,staging,prod"). If empty, event notifications will be sent about all branches.
17 | 7. **Alternative Endpoint** - Specify the full URL for the Zulip server's GitHub endpoint (e.g., https://zulip.example.com/api/v1/external/github). If empty, the integration will talk to zulip.com.
18 |
19 | Checkboxes
20 | ----------
21 |
22 | 1. **Exclude Pull Requests** - Don't send GitHub pull request notifications to Zulip.
23 | 2. **Exclude Issues** - Don't send GitHub issues notifications to Zulip.
24 | 3. **Exclude Commits** - Don't send Git commit notifcations to Zulip.
25 |
--------------------------------------------------------------------------------
/lib/services/simperium.rb:
--------------------------------------------------------------------------------
1 | class Service::Simperium < Service::HttpPost
2 | string :app_id, :bucket
3 | password :token
4 |
5 | white_list :app_id, :bucket
6 |
7 | default_events :push, :issues, :issue_comment, :commit_comment,
8 | :pull_request, :pull_request_review_comment, :watch, :fork,
9 | :fork_apply, :member, :public, :team_add, :status
10 |
11 | url "https://simperium.com"
12 | logo_url "https://simperium.com/media/images/simperium_logo_black_sm.png"
13 |
14 | maintained_by :github => 'fredrocious',
15 | :twitter => '@fredrocious'
16 |
17 | supported_by :web => 'https://simperium.com/contact',
18 | :email => 'help@simperium.com',
19 | :twitter => '@simperium'
20 |
21 | def receive_event
22 | appid = required_config_value('app_id')
23 | token = required_config_value('token')
24 | bucket = required_config_value('bucket')
25 |
26 | if appid.match(/^[A-Za-z0-9-]+$/) == nil
27 | raise_config_error "Invalid app id"
28 | end
29 |
30 | if token.match(/^[A-Za-z0-9]+$/) == nil
31 | raise_config_error "Invalid token"
32 | end
33 |
34 | if bucket.match(/^[A-Za-z0-9\-\.@]+$/) == nil
35 | raise_config_error "Invalid bucket name"
36 | end
37 |
38 | http.headers['Authorization'] = "Token #{token}"
39 |
40 | url = "https://api.simperium.com:443/1/#{appid}/#{bucket}/i/#{delivery_guid}"
41 | deliver url
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/lib/services/pushover.rb:
--------------------------------------------------------------------------------
1 | class Service::Pushover < Service
2 | string :user_key, :device_name
3 | white_list :device_name
4 |
5 | def receive_push
6 | if !payload["commits"].any?
7 | return
8 | end
9 |
10 | if !data["user_key"]
11 | raise_config_error "Invalid Pushover user key."
12 | end
13 |
14 | url = URI.parse("https://api.pushover.net/1/messages.json")
15 |
16 | commits = payload["commits"].length
17 | repo = payload["repository"]["url"].split("/")[-2 .. -1].join("/")
18 | latest_message = payload["commits"].last["message"].split("\n").first
19 | if latest_message.length > 100
20 | latest_message = latest_message[0 ... 96] + "[..]"
21 | end
22 | latest_url = shorten_url(payload["commits"].last["url"])
23 |
24 | if commits == 1
25 | title = "#{payload["pusher"]["name"]} pushed to #{repo}"
26 | message = latest_message
27 | else
28 | title = "#{payload["pusher"]["name"]} pushed #{commits} " +
29 | "commit#{commits == 1 ? '' : 's'} to #{repo}"
30 | message = "Latest: #{latest_message}"
31 | end
32 |
33 | http_post url.to_s,
34 | :token => "E6jpcJjaeASA7CWQ0cYjW6oP9N5xtJ",
35 | :user => data["user_key"],
36 | :device => data["device_name"],
37 | :title => title,
38 | :message => message,
39 | :url => latest_url,
40 | :url_title => "View commit on GitHub"
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/test/bugherd_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../helper', __FILE__)
2 |
3 | class BugHerdTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | end
7 |
8 | def test_push
9 | @stubs.post "/github_web_hook/KEY" do |env|
10 | assert_equal 'www.bugherd.com', env[:url].host
11 | assert_equal 'application/x-www-form-urlencoded',
12 | env[:request_headers]['content-type']
13 | [200, {}, '']
14 | end
15 |
16 | svc = service :push, {'project_key' => 'KEY'}, payload
17 | svc.receive_push
18 | end
19 |
20 | def test_issues
21 | @stubs.post "/github_web_hook/KEY" do |env|
22 | assert_equal 'www.bugherd.com', env[:url].host
23 | assert_equal 'application/x-www-form-urlencoded',
24 | env[:request_headers]['content-type']
25 | [200, {}, '']
26 | end
27 |
28 | svc = service :push, {'project_key' => 'KEY'}, payload
29 | svc.receive_issues
30 | end
31 |
32 | def test_issue_comment
33 | @stubs.post "/github_web_hook/KEY" do |env|
34 | assert_equal 'www.bugherd.com', env[:url].host
35 | assert_equal 'application/x-www-form-urlencoded',
36 | env[:request_headers]['content-type']
37 | [200, {}, '']
38 | end
39 |
40 | svc = service :push, {'project_key' => 'KEY'}, payload
41 | svc.receive_issue_comment
42 | end
43 |
44 | def service(*args)
45 | super Service::BugHerd, *args
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/test/zendesk_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../helper", __FILE__)
2 |
3 | class ZendeskTest < Service::TestCase
4 | def setup
5 | @stubs = Faraday::Adapter::Test::Stubs.new
6 | @data = { "username" => "user", "password" => "pass", "subdomain" => "igor" }
7 | @payload = { :message => "My name is zd#12345 what do you say?" }
8 | end
9 |
10 | def test_subdomain
11 | post
12 | svc = service :event, @data, @payload
13 | svc.receive_event
14 | end
15 |
16 | def test_domain
17 | post
18 |
19 | svc = service :event, @data.merge("subdomain" => "igor.zendesk.com"), @payload
20 | svc.receive_event
21 | end
22 |
23 | def test_unmatched_ticket
24 | post
25 |
26 | svc = service :event, @data, { :message => "Nothing to match" }
27 | svc.receive_event
28 |
29 | begin
30 | @stubs.verify_stubbed_calls
31 | rescue RuntimeError
32 | else
33 | assert_true false
34 | end
35 | end
36 |
37 | def post
38 | @stubs.post "/api/v2/integrations/github?ticket_id=12345" do |env|
39 | assert_equal "application/json", env[:request_headers]["Content-Type"]
40 | assert_equal "igor.zendesk.com", env[:url].host
41 | assert_equal "12345", env[:params]["ticket_id"]
42 | assert_equal JSON.generate({ :payload => @payload }), env[:body]
43 | [ 201, {}, "" ]
44 | end
45 | end
46 |
47 | def service(*args)
48 | super Service::Zendesk, *args
49 | end
50 | end
51 |
--------------------------------------------------------------------------------