Skip to content

Removing push notifications from IRC hooks

Josh Matthews edited this page Oct 21, 2015 · 3 revisions

Based on http://akrabat.com/changing-the-github-irc-hooks-notification-events/:

Generate an API token, then use the API to manipulate the IRC hook for your chosen repository:

$ curl -u '[user]:[token]' -H 'Accept: application/json' https://api.github.com/repos/servo/servo/hooks
[
  {
    "url": "https://api.github.com/repos/servo/servo/hooks/454071",
    "test_url": "https://api.github.com/repos/servo/servo/hooks/454071/test",
    "ping_url": "https://api.github.com/repos/servo/servo/hooks/454071/pings",
    "id": 454071,
    "name": "irc",
    "active": true,
    "events": [
      "issues",
      "push",
      "pull_request"
    ],
    "config": {
      "server": "irc.mozilla.org",
      "port": "6697",
      "room": "#servo",
      "nick": "ghservo",
      "branch_regexes": "",
      "nickserv_password": "",
      "password": "",
      "ssl": "1",
      "notice": "1",
      "branches": "",
      "message_without_join": "0",
      "no_colors": "0",
      "long_url": "0"
    },
    "last_response": {
      "code": 200,
      "status": "active",
      "message": "OK"
    },
    "updated_at": "2015-10-21T18:19:16Z",
    "created_at": "2012-10-08T23:51:22Z"
  },
  {
    ...
  }
]
$ curl -u '[username]:[token]' -H 'Accept: application/json' -H "Content-Type: application/json" -X PATCH https://api.github.com/repos/servo/servo/hooks/454071 -d '{"events":["pull_request","issues"]}'
{
  "url": "https://api.github.com/repos/servo/servo/hooks/454071",
  "test_url": "https://api.github.com/repos/servo/servo/hooks/454071/test",
  "ping_url": "https://api.github.com/repos/servo/servo/hooks/454071/pings",
  "id": 454071,
  "name": "irc",
  "active": true,
  "events": [
    "pull_request",
    "issues"
  ],
  "config": {
    "server": "irc.mozilla.org",
    "port": "6697",
    "room": "#servo",
    "nick": "ghservo",
    "branch_regexes": "",
    "nickserv_password": "",
    "password": "",
    "ssl": "1",
    "notice": "1",
    "branches": "",
    "message_without_join": "0",
    "no_colors": "0",
    "long_url": "0"
  },
  "last_response": {
    "code": 200,
    "status": "active",
    "message": "OK"
  },
  "updated_at": "2015-10-21T18:21:49Z",
  "created_at": "2012-10-08T23:51:22Z"
}
Clone this wiki locally