├── .gitattributes ├── tests ├── events │ ├── ping │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── push │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── delete │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── gollum │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── member │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── package │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── ping_org │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── project │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── public │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── push_created │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── push_tag │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── release │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── issue_closed │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── issue_opened │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── milestone │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── push_created_plus │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── push_no_author │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── repository │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── issue_comment │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── release_no_name │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── commit_comment │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── discussion_created │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── issue_closed_not_planned │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── pull_request_merged │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── release_different_name │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── repository_renamed │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── issue_comment_delete │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── pull_request_dependabot │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── push_branch_with_underscores │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── repository_transferred │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── issue_comment_many_new_lines │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── issue_comment_pull_request │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── pull_request_review │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── discussion_comment_created │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── pull_request_auto_merge_enabled │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── pull_request_review_comment │ │ ├── type.txt │ │ ├── expected.bin │ │ └── discord.json │ ├── repository_vulnerability_alert │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ ├── repository_vulnerability_alert_dismiss │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json │ └── repository_vulnerability_alert_resolve │ │ ├── type.txt │ │ ├── expected.bin │ │ ├── discord.json │ │ └── payload.json ├── UnknownEventTest.php ├── IgnoredEventTest.php ├── UnknownActionTest.php ├── EventTest.php └── IgnoredActionsThrowTest.php ├── .gitignore ├── composer.json ├── .editorconfig ├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── phpstan.neon ├── Bootstrap.php ├── src ├── IgnoredEventException.php ├── NotImplementedException.php ├── BaseConverter.php └── GitHubWebHook.php ├── phpunit.xml ├── examples ├── config.php ├── index.php ├── discord.php └── irker.php ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /tests/events/ping/type.txt: -------------------------------------------------------------------------------- 1 | ping 2 | -------------------------------------------------------------------------------- /tests/events/push/type.txt: -------------------------------------------------------------------------------- 1 | push 2 | -------------------------------------------------------------------------------- /tests/events/delete/type.txt: -------------------------------------------------------------------------------- 1 | delete 2 | -------------------------------------------------------------------------------- /tests/events/gollum/type.txt: -------------------------------------------------------------------------------- 1 | gollum 2 | -------------------------------------------------------------------------------- /tests/events/member/type.txt: -------------------------------------------------------------------------------- 1 | member 2 | -------------------------------------------------------------------------------- /tests/events/package/type.txt: -------------------------------------------------------------------------------- 1 | package 2 | -------------------------------------------------------------------------------- /tests/events/ping_org/type.txt: -------------------------------------------------------------------------------- 1 | ping 2 | -------------------------------------------------------------------------------- /tests/events/project/type.txt: -------------------------------------------------------------------------------- 1 | project 2 | -------------------------------------------------------------------------------- /tests/events/public/type.txt: -------------------------------------------------------------------------------- 1 | public 2 | -------------------------------------------------------------------------------- /tests/events/push_created/type.txt: -------------------------------------------------------------------------------- 1 | push 2 | -------------------------------------------------------------------------------- /tests/events/push_tag/type.txt: -------------------------------------------------------------------------------- 1 | push 2 | -------------------------------------------------------------------------------- /tests/events/release/type.txt: -------------------------------------------------------------------------------- 1 | release 2 | -------------------------------------------------------------------------------- /tests/events/issue_closed/type.txt: -------------------------------------------------------------------------------- 1 | issues 2 | -------------------------------------------------------------------------------- /tests/events/issue_opened/type.txt: -------------------------------------------------------------------------------- 1 | issues 2 | -------------------------------------------------------------------------------- /tests/events/milestone/type.txt: -------------------------------------------------------------------------------- 1 | milestone 2 | -------------------------------------------------------------------------------- /tests/events/push_created_plus/type.txt: -------------------------------------------------------------------------------- 1 | push 2 | -------------------------------------------------------------------------------- /tests/events/push_no_author/type.txt: -------------------------------------------------------------------------------- 1 | push 2 | -------------------------------------------------------------------------------- /tests/events/repository/type.txt: -------------------------------------------------------------------------------- 1 | repository 2 | -------------------------------------------------------------------------------- /tests/events/issue_comment/type.txt: -------------------------------------------------------------------------------- 1 | issue_comment 2 | -------------------------------------------------------------------------------- /tests/events/release_no_name/type.txt: -------------------------------------------------------------------------------- 1 | release 2 | -------------------------------------------------------------------------------- /tests/events/commit_comment/type.txt: -------------------------------------------------------------------------------- 1 | commit_comment 2 | -------------------------------------------------------------------------------- /tests/events/discussion_created/type.txt: -------------------------------------------------------------------------------- 1 | discussion 2 | -------------------------------------------------------------------------------- /tests/events/issue_closed_not_planned/type.txt: -------------------------------------------------------------------------------- 1 | issues 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_merged/type.txt: -------------------------------------------------------------------------------- 1 | pull_request 2 | -------------------------------------------------------------------------------- /tests/events/release_different_name/type.txt: -------------------------------------------------------------------------------- 1 | release 2 | -------------------------------------------------------------------------------- /tests/events/repository_renamed/type.txt: -------------------------------------------------------------------------------- 1 | repository 2 | -------------------------------------------------------------------------------- /tests/events/issue_comment_delete/type.txt: -------------------------------------------------------------------------------- 1 | issue_comment 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_dependabot/type.txt: -------------------------------------------------------------------------------- 1 | pull_request 2 | -------------------------------------------------------------------------------- /tests/events/push_branch_with_underscores/type.txt: -------------------------------------------------------------------------------- 1 | push 2 | -------------------------------------------------------------------------------- /tests/events/repository_transferred/type.txt: -------------------------------------------------------------------------------- 1 | repository 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | .phpunit.result.cache 4 | -------------------------------------------------------------------------------- /tests/events/issue_comment_many_new_lines/type.txt: -------------------------------------------------------------------------------- 1 | issue_comment 2 | -------------------------------------------------------------------------------- /tests/events/issue_comment_pull_request/type.txt: -------------------------------------------------------------------------------- 1 | issue_comment 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_review/type.txt: -------------------------------------------------------------------------------- 1 | pull_request_review 2 | -------------------------------------------------------------------------------- /tests/events/discussion_comment_created/type.txt: -------------------------------------------------------------------------------- 1 | discussion_comment 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_auto_merge_enabled/type.txt: -------------------------------------------------------------------------------- 1 | pull_request 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_review_comment/type.txt: -------------------------------------------------------------------------------- 1 | pull_request_review_comment 2 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert/type.txt: -------------------------------------------------------------------------------- 1 | repository_vulnerability_alert 2 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_dismiss/type.txt: -------------------------------------------------------------------------------- 1 | repository_vulnerability_alert 2 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_resolve/type.txt: -------------------------------------------------------------------------------- 1 | repository_vulnerability_alert 2 | -------------------------------------------------------------------------------- /tests/events/delete/expected.bin: -------------------------------------------------------------------------------- 1 | [10Hello-World] 12C‍odertocat 04deleted tag 06s‍imple-tag 2 | -------------------------------------------------------------------------------- /tests/events/member/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw 09added 12t‍immw as a collaborator 2 | -------------------------------------------------------------------------------- /tests/events/ping_org/expected.bin: -------------------------------------------------------------------------------- 1 | [10org: SteamDatabase] Hook 14123 worked! Zen: 12D‍esign for failure. 2 | -------------------------------------------------------------------------------- /tests/events/ping/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] Hook 147292732 worked! Zen: 12A‍nything added dilutes everything else. 2 | -------------------------------------------------------------------------------- /tests/events/repository/expected.bin: -------------------------------------------------------------------------------- 1 | [10new-repository] 12x‍Paw 07created this repository. 02https://github.com/SteamDatabase/new-repository 2 | -------------------------------------------------------------------------------- /tests/events/issue_closed/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw 13closed issue 12#5: Add tests. 02https://github.com/xPaw/GitHub-WebHook/issues/5 2 | -------------------------------------------------------------------------------- /tests/events/project/expected.bin: -------------------------------------------------------------------------------- 1 | [10Hello-World] 12C‍odertocat 07created project: Space 2.0. 02https://github.com/Codertocat/Hello-World/projects/1 2 | -------------------------------------------------------------------------------- /tests/events/milestone/expected.bin: -------------------------------------------------------------------------------- 1 | [10Hello-World] 12C‍odertocat 07created milestone 12#1: v1.0. 02https://github.com/Codertocat/Hello-World/milestone/1 2 | -------------------------------------------------------------------------------- /tests/events/repository_renamed/expected.bin: -------------------------------------------------------------------------------- 1 | [10steamdb.info-issues] 12x‍Paw 09renamed this repository. 02https://github.com/SteamDatabase/steamdb.info-issues 2 | -------------------------------------------------------------------------------- /tests/events/repository_transferred/expected.bin: -------------------------------------------------------------------------------- 1 | [10SteamDocsScraper] 12x‍Paw 09transferred this repository. 02https://github.com/SteamDatabase/SteamDocsScraper 2 | -------------------------------------------------------------------------------- /tests/events/issue_closed_not_planned/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw 13closed issue 12#5: Add tests. 02https://github.com/xPaw/GitHub-WebHook/issues/5 2 | -------------------------------------------------------------------------------- /tests/events/issue_comment_delete/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw deleted comment in 12#502 14(Optimize texture and animation loading) from 12x‍Paw 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": { 3 | "phpunit/phpunit": "^12", 4 | "phpstan/phpstan": "^2.1", 5 | "phpstan/phpstan-strict-rules": "^2.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert/expected.bin: -------------------------------------------------------------------------------- 1 | [10Hello-World] ⚠ New vulnerability for 12r‍ack: 12CVE-2018-16470 02https://nvd.nist.gov/vuln/detail/CVE-2018-16470 2 | -------------------------------------------------------------------------------- /tests/events/public/expected.bin: -------------------------------------------------------------------------------- 1 | [10new-private-repository] is now open source and available to everyone at 02https://github.com/xPaw/new-private-repository (You're the best 12x‍Paw!) 2 | -------------------------------------------------------------------------------- /tests/events/release/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw 09published a pre-release 060‍.0.4: 02https://github.com/SteamDatabase/ValveResourceFormat/releases/tag/0.0.4 2 | -------------------------------------------------------------------------------- /tests/events/discussion_created/expected.bin: -------------------------------------------------------------------------------- 1 | [10octo-repo] 12C‍odertocat 07created discussion 12#90: Welcome to discussions!. 02https://github.com/octo-org/octo-repo/discussions/90 2 | -------------------------------------------------------------------------------- /tests/events/package/expected.bin: -------------------------------------------------------------------------------- 1 | [10hello-world-npm] 12C‍odertocat 09published npm package: hello-world-npm 061‍.0.0. 02https://github.com/Codertocat/hello-world-npm/packages/10696 2 | -------------------------------------------------------------------------------- /tests/events/release_no_name/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw 09published a pre-release 060‍.0.4: 02https://github.com/SteamDatabase/ValveResourceFormat/releases/tag/0.0.4 2 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_dismiss/expected.bin: -------------------------------------------------------------------------------- 1 | [10Hello-World] Vulnerability 04dismissed for 12r‍ack: 12CVE-2018-16470 02https://nvd.nist.gov/vuln/detail/CVE-2018-16470 2 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_resolve/expected.bin: -------------------------------------------------------------------------------- 1 | [10Hello-World] Vulnerability 07resolved for 12r‍ack: 12CVE-2018-16470 02https://nvd.nist.gov/vuln/detail/CVE-2018-16470 2 | -------------------------------------------------------------------------------- /tests/events/issue_comment_many_new_lines/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw commented on 12#5 14(Add tests): line… 02https://github.com/xPaw/GitHub-WebHook/issues/5#issuecomment-183873315 2 | -------------------------------------------------------------------------------- /tests/events/issue_opened/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw 09opened issue 12#508: Particle rendering is busted. 02https://github.com/SteamDatabase/ValveResourceFormat/issues/508 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_review_comment/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw reviewed pull request 12#2 at 1471f40a. 02https://github.com/xPaw/GitHub-WebHook/pull/2#discussion_r52840876 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_merged/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw 13merged pull request 12#6 from 12x‍Paw to 06m‍aster: test pull request. 02https://github.com/xPaw/GitHub-WebHook/pull/6 2 | -------------------------------------------------------------------------------- /tests/events/gollum/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw 09edited _Sidebar: 02https://github.com/SteamDatabase/ValveResourceFormat/wiki/_Sidebar/_compare/94b8720e6a96a73ddbb639b06e5b29b98eb81a36 2 | -------------------------------------------------------------------------------- /tests/events/issue_comment/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw commented on 12#5 14(Add tests): test issue comment :heart: 02https://github.com/xPaw/GitHub-WebHook/issues/5#issuecomment-183873315 2 | -------------------------------------------------------------------------------- /tests/events/release_different_name/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw 09published a pre-release 06S‍ome cool fixes: 02https://github.com/SteamDatabase/ValveResourceFormat/releases/tag/0.0.4 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_auto_merge_enabled/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw 09enabled auto-merge pull request 12#328: Fix white eyelashes. 02https://github.com/SteamDatabase/ValveResourceFormat/pull/328 2 | -------------------------------------------------------------------------------- /tests/events/commit_comment/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw commented on commit 14daf13d: test commit comment :heart: 02https://github.com/xPaw/GitHub-WebHook/commit/daf13dcaf435472847deec105edc97a29c30465d#commitcomment-16082791 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_dependabot/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12d‍ependabot[bot] 09opened pull request 12#311: Bump Microsoft.NET.Test.Sdk from 16.7.1 to 16.8.0. 02https://github.com/SteamDatabase/ValveResourceFormat/pull/311 2 | -------------------------------------------------------------------------------- /tests/events/pull_request_review/expected.bin: -------------------------------------------------------------------------------- 1 | [10Hello-World] 12C‍odertocat 04requested changes in pull request 12#2: Update the README with new information.. 02https://github.com/Codertocat/Hello-World/pull/2#pullrequestreview-237895671 2 | -------------------------------------------------------------------------------- /tests/events/push/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw pushed 121 new commit to 06m‍aster: Add event tests that can be easily expanded to cov… 02https://github.com/xPaw/GitHub-WebHook/commit/8ddec647cc7a5a819669ad55d08cfabe49925311 2 | -------------------------------------------------------------------------------- /tests/events/push_created/expected.bin: -------------------------------------------------------------------------------- 1 | [10GitHub-WebHook] 12x‍Paw created 06h‍ello-world from 06m‍aster 02https://github.com/xPaw/GitHub-WebHook/compare/0000000000000000000000000000000000000000..a192fe8a896a1547fa6d7a607d4b0b78c5fa7909 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = tab 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /tests/events/push_tag/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw tagged 060‍.0.4 at 06m‍aster 02https://github.com/SteamDatabase/ValveResourceFormat/compare/0000000000000000000000000000000000000000..291b9dd498f2e61f9e26981aef691166c23a80a4 2 | -------------------------------------------------------------------------------- /tests/events/push_no_author/expected.bin: -------------------------------------------------------------------------------- 1 | [10DotaTracking] 12S‍inZ163 pushed 121 new commit to 06m‍aster: Update gitignore and add a readme to dota/gamemode… 02https://github.com/ModDota/DotaTracking/commit/56008277f8643ad2f56ec9ef1a4bf265280ee171 2 | -------------------------------------------------------------------------------- /tests/events/discussion_comment_created/expected.bin: -------------------------------------------------------------------------------- 1 | [10octo-repo] 12C‍odertocat commented on discussion 12#90 14(Welcome to discussions!): I have so many questions to ask you! 02https://github.com/octo-org/octo-repo/discussions/90#discussioncomment-544078 2 | -------------------------------------------------------------------------------- /tests/events/issue_comment_pull_request/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12x‍Paw commented on 12#501 14(Optimise InitializeTreeViewFromPackage): Merged in f0e5515ea394d6a2dec54283942c66920193f747 02https://github.com/SteamDatabase/ValveResourceFormat/pull/501#issuecomment-1367808276 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | ignore: 8 | - dependency-name: "*" 9 | update-types: ["version-update:semver-minor", "version-update:semver-patch"] 10 | -------------------------------------------------------------------------------- /tests/events/push_branch_with_underscores/expected.bin: -------------------------------------------------------------------------------- 1 | [10ValveResourceFormat] 12l‍ewa-j created 06f‍ix_export_with_alpha at 1446f500 (+121 new commit): Fix PNG export of textures with non transparency d… 02https://github.com/SteamDatabase/ValveResourceFormat/commit/46f500abc031be1eb4ea7611eaf622773b47dcac 2 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - vendor/phpstan/phpstan-strict-rules/rules.neon 3 | parameters: 4 | level: 9 5 | paths: 6 | - . 7 | excludePaths: 8 | - vendor/ 9 | - examples/ 10 | ignoreErrors: 11 | - identifier: empty.notAllowed 12 | 13 | - message: "/Access to an undefined property object::.*/" 14 | path: src/*.php 15 | -------------------------------------------------------------------------------- /Bootstrap.php: -------------------------------------------------------------------------------- 1 | EventName = $Event; 13 | 14 | parent::__construct( 'Event type "' . $Event . '" is ignored by design due to spammy nature of the event.' ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/events/ping_org/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "Hook 123 worked!", 5 | "description": "Design for failure.", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars3.githubusercontent.com\/u\/613331?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/ping/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "Hook 7292732 worked!", 5 | "description": "Anything added dilutes everything else.", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/member/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "added **timmw** as a collaborator", 5 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/repository/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "created **new-repository**", 5 | "url": "https:\/\/github.com\/SteamDatabase\/new-repository", 6 | "color": 16750592, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tests 6 | 7 | 8 | 9 | 10 | 11 | src 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/events/delete/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "deleted tag `simple-tag`", 5 | "url": "https:\/\/github.com\/Codertocat\/Hello-World", 6 | "color": 16007990, 7 | "author": { 8 | "name": "Codertocat", 9 | "url": "https:\/\/github.com\/Codertocat", 10 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/21031067?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/issue_closed/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "Issue **#5** closed: Add tests", 5 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/issues\/5", 6 | "color": 8540383, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/release/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "published a pre-release: 0.0.4", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/releases\/tag\/0.0.4", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/issue_closed_not_planned/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "Issue **#5** closed as not planned: Add tests", 5 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/issues\/5", 6 | "color": 8540383, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/public/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "new-private-repository is now open source and available to everyone!", 5 | "url": "https:\/\/github.com\/xPaw\/new-private-repository", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/release_no_name/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "published a pre-release: 0.0.4", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/releases\/tag\/0.0.4", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/repository_transferred/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "transferred **SteamDocsScraper** (from *xPaw*)", 5 | "url": "https:\/\/github.com\/SteamDatabase\/SteamDocsScraper", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/UnknownEventTest.php: -------------------------------------------------------------------------------- 1 | expectException( NotImplementedException::class ); 12 | $this->expectExceptionMessage( 'Unsupported event type' ); 13 | 14 | $Parser = new IrcConverter( 'surely_this_event_does_not_exist', (object)[] ); 15 | $Parser->GetMessage(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/events/repository_renamed/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "renamed **steamdb.info-issues** (from *steamdb.info*)", 5 | "url": "https:\/\/github.com\/SteamDatabase\/steamdb.info-issues", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_resolve/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "Vulnerability for **rack** resolved", 5 | "url": "https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2018-16470", 6 | "color": 16750592, 7 | "author": { 8 | "name": "github", 9 | "url": "https:\/\/github.com\/github", 10 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/9919?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_dismiss/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "Vulnerability for **rack** dismissed", 5 | "url": "https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2018-16470", 6 | "color": 16007990, 7 | "author": { 8 | "name": "github", 9 | "url": "https:\/\/github.com\/github", 10 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/9919?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/push_created/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "created `hello-world` from `master`", 5 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/compare\/0000000000000000000000000000000000000000..a192fe8a896a1547fa6d7a607d4b0b78c5fa7909", 6 | "author": { 7 | "name": "xPaw", 8 | "url": "https:\/\/github.com\/xPaw", 9 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 10 | } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/events/issue_comment_delete/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "deleted comment in PR **#502** from xPaw", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/pull\/502#issuecomment-1367801889", 6 | "color": 16007990, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/pull_request_auto_merge_enabled/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "PR **#328** enabled auto-merge: Fix white eyelashes", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/pull\/328", 6 | "color": 16750592, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/release_different_name/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "published a pre-release: 0.0.4 \\(Some cool fixes\\)", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/releases\/tag\/0.0.4", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/gollum/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "updated wiki", 5 | "description": "[edited \\_Sidebar](https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/wiki\/_Sidebar\/_compare\/94b8720e6a96a73ddbb639b06e5b29b98eb81a36)", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/pull_request_merged/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "PR **#6** merged: test pull request", 5 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/pull\/6", 6 | "color": 7291585, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 11 | }, 12 | "description": "Merged from **xPaw** to `master`" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/milestone/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "created milestone **#1**: v1.0", 5 | "description": "Add new space flight simulator", 6 | "url": "https:\/\/github.com\/Codertocat\/Hello-World\/milestone\/1", 7 | "color": 16750592, 8 | "author": { 9 | "name": "Codertocat", 10 | "url": "https:\/\/github.com\/Codertocat", 11 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/21031067?v=4" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/project/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "created project **#1**: Space 2.0", 5 | "description": "Project tasks for a trip to Space", 6 | "url": "https:\/\/github.com\/Codertocat\/Hello-World\/projects\/1", 7 | "color": 16750592, 8 | "author": { 9 | "name": "Codertocat", 10 | "url": "https:\/\/github.com\/Codertocat", 11 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/21031067?v=4" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/push_tag/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "tagged `0.0.4` at `master`", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/compare\/0000000000000000000000000000000000000000..291b9dd498f2e61f9e26981aef691166c23a80a4", 6 | "author": { 7 | "name": "xPaw", 8 | "url": "https:\/\/github.com\/xPaw", 9 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 10 | }, 11 | "color": 5025616 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/issue_comment/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "commented on issue **#5**: Add tests", 5 | "description": "test issue comment :heart: ", 6 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/issues\/5#issuecomment-183873315", 7 | "color": 16750592, 8 | "author": { 9 | "name": "xPaw", 10 | "url": "https:\/\/github.com\/xPaw", 11 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/pull_request_review/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "requested changes in PR **#2**: Update the README with new information.", 5 | "url": "https:\/\/github.com\/Codertocat\/Hello-World\/pull\/2#pullrequestreview-237895671", 6 | "color": 16007990, 7 | "author": { 8 | "name": "Codertocat", 9 | "url": "https:\/\/github.com\/Codertocat", 10 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/21031067?v=4" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/NotImplementedException.php: -------------------------------------------------------------------------------- 1 | EventName = $Event; 13 | 14 | if( $Action !== null ) 15 | { 16 | $Message = 'Unsupported action type "' . $Action . '" in event type'; 17 | } 18 | else 19 | { 20 | $Message = 'Unsupported event type'; 21 | } 22 | 23 | parent::__construct( $Message . ' "' . $Event . '".' ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/events/commit_comment/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "commented on commit `daf13d`", 5 | "description": "test commit comment :heart: ", 6 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/daf13dcaf435472847deec105edc97a29c30465d#commitcomment-16082791", 7 | "color": 16750592, 8 | "author": { 9 | "name": "xPaw", 10 | "url": "https:\/\/github.com\/xPaw", 11 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/discussion_created/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": ":speech_balloon: Discussion **#90** created: Welcome to discussions!", 5 | "url": "https:\/\/github.com\/octo-org\/octo-repo\/discussions\/90", 6 | "color": 16750592, 7 | "author": { 8 | "name": "Codertocat", 9 | "url": "https:\/\/github.com\/Codertocat", 10 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/21031067?v=4" 11 | }, 12 | "description": "We're glad to have you here!" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/pull_request_review_comment/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "reviewed PR **#2**: Workaround filter\\_input bug", 5 | "description": "this is a pull request review comment :heart:", 6 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/pull\/2#discussion_r52840876", 7 | "color": 16750592, 8 | "author": { 9 | "name": "xPaw", 10 | "url": "https:\/\/github.com\/xPaw", 11 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/discussion_comment_created/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "commented on discussion **#90**: Welcome to discussions!", 5 | "description": "I have so many questions to ask you!", 6 | "url": "https:\/\/github.com\/octo-org\/octo-repo\/discussions\/90#discussioncomment-544078", 7 | "color": 16750592, 8 | "author": { 9 | "name": "Codertocat", 10 | "url": "https:\/\/github.com\/Codertocat", 11 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/21031067?v=4" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | permissions: 4 | contents: read 5 | 6 | on: [push] 7 | 8 | jobs: 9 | php: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | php: ['8.4'] 14 | steps: 15 | - name: Setup PHP 16 | uses: shivammathur/setup-php@v2 17 | with: 18 | php-version: ${{ matrix.php }} 19 | - uses: actions/checkout@v4 20 | - name: Install dependencies 21 | run: composer install --no-interaction --no-progress 22 | - name: Run tests 23 | run: php vendor/bin/phpunit --fail-on-warning --coverage-text 24 | - name: Run phpstan 25 | run: php vendor/bin/phpstan analyse 26 | -------------------------------------------------------------------------------- /tests/events/issue_comment_pull_request/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "commented on PR **#501**: Optimise InitializeTreeViewFromPackage", 5 | "description": "Merged in f0e5515ea394d6a2dec54283942c66920193f747", 6 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/pull\/501#issuecomment-1367808276", 7 | "color": 16750592, 8 | "author": { 9 | "name": "xPaw", 10 | "url": "https:\/\/github.com\/xPaw", 11 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=4" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/push/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "pushed 1 new commit to `master`", 5 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/compare\/14e514deb5f8...8ddec647cc7a", 6 | "author": { 7 | "name": "xPaw", 8 | "url": "https:\/\/github.com\/xPaw", 9 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 10 | }, 11 | "description": "[`8ddec6`](https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/8ddec647cc7a5a819669ad55d08cfabe49925311) Add event tests that can be easily expanded to cover more events" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/push_no_author/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "pushed 1 new commit to `master`", 5 | "url": "https:\/\/github.com\/ModDota\/DotaTracking\/compare\/c31b58451bb8...56008277f864", 6 | "author": { 7 | "name": "SinZ163", 8 | "url": "https:\/\/github.com\/SinZ163", 9 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/767456?v=4" 10 | }, 11 | "description": "[`560082`](https:\/\/github.com\/ModDota\/DotaTracking\/commit\/56008277f8643ad2f56ec9ef1a4bf265280ee171) Update gitignore and add a readme to dota\/gamemode\/content to keep folder alive - *Dota \\*test\\* Tracking*" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/push_branch_with_underscores/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "created `fix_export_with_alpha` at `46f500` (+1 new commit)", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/commit\/46f500abc031", 6 | "author": { 7 | "name": "lewa-j", 8 | "url": "https:\/\/github.com\/lewa-j", 9 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/5416122?v=4" 10 | }, 11 | "description": "[`46f500`](https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/commit\/46f500abc031be1eb4ea7611eaf622773b47dcac) Fix PNG export of textures with non transparency data in the alpha channel" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/IgnoredEventTest.php: -------------------------------------------------------------------------------- 1 | expectException( IgnoredEventException::class ); 14 | 15 | $Parser = new IrcConverter( $Event, (object)[] ); 16 | $Parser->GetMessage(); 17 | } 18 | 19 | /** 20 | * @return array> 21 | */ 22 | public static function ignoredEventProvider( ) : array 23 | { 24 | return [ 25 | [ 'fork' ], 26 | [ 'watch' ], 27 | [ 'star' ], 28 | [ 'status' ], 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/events/issue_comment_many_new_lines/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "commented on issue **#5**: Add tests", 5 | "description": "line\nline\nline\nline\nline\nline\nline\nline\nline\nline\nline line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line \u2026", 6 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/issues\/5#issuecomment-183873315", 7 | "color": 16750592, 8 | "author": { 9 | "name": "xPaw", 10 | "url": "https:\/\/github.com\/xPaw", 11 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/package/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "published npm package: **hello-world-npm** 1.0.0", 5 | "description": "# hello-world-npm\nThis is a simple npm package that demonstrates the [Github Packages](https:\/\/github.com\/features\/package).\n## Installation \n`$ npm install`\n## Usage\n```\nconst myPackage = require('hello-world-node-package');\nmyPackage.helloWorld();\n\u2026", 6 | "url": "https:\/\/github.com\/Codertocat\/hello-world-npm\/packages\/10696", 7 | "color": 5025616, 8 | "author": { 9 | "name": "Codertocat", 10 | "url": "https:\/\/github.com\/Codertocat", 11 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/21031067?v=4" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /examples/config.php: -------------------------------------------------------------------------------- 1 | array( 14 | "irc://chat.freenode.net/#steamlug" 15 | ), 16 | "SteamDatabase/*" => array( 17 | "irc://chat.freenode.net/#steamdb" 18 | ), 19 | /* Personal */ 20 | "meklu/mekoverlay" => array( 21 | "irc://chat.freenode.net/meklu,isnick" 22 | ), 23 | ); 24 | 25 | /* Send config */ 26 | $DiscordWebhooks = array( 27 | "SteamDatabase/SteamLinux" => array( 28 | "https://discord.com/webhook/.........." 29 | ), 30 | "SteamDatabase/*" => array( 31 | "https://discord.com/webhook/.........." 32 | ), 33 | ); 34 | -------------------------------------------------------------------------------- /tests/events/issue_opened/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "Issue **#508** opened: Particle rendering is busted", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/issues\/508", 6 | "color": 5025616, 7 | "author": { 8 | "name": "xPaw", 9 | "url": "https:\/\/github.com\/xPaw", 10 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=4" 11 | }, 12 | "description": "Seems like a combination of Valve updating some of the particle stuff, and our code not handling certain things.\nIt needs a loving pass to fix up the existing stuff we have. I committed a few fix which should ease the task.", 13 | "footer": { 14 | "text": "bug" 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /tests/events/pull_request_dependabot/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "PR **#311** opened: Bump Microsoft.NET.Test.Sdk from 16.7.1 to 16.8.0", 5 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/pull\/311", 6 | "color": 5025616, 7 | "author": { 8 | "name": "dependabot[bot]", 9 | "url": "https:\/\/github.com\/apps\/dependabot", 10 | "icon_url": "https:\/\/avatars0.githubusercontent.com\/in\/29110?v=4" 11 | }, 12 | "description": "Bumps [Microsoft.NET.Test.Sdk](https:\/\/github.com\/microsoft\/vstest) from 16.7.1 to 16.8.0.\nRelease notes\nSourced from Microsoft.NET.Test.Sdk's releases.\nv16.8.0\nSee the release notes here.\nv16.8.0-preview-20200921-01\nSee the release notes here.\nv16.8\u2026" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tests/events/push_created_plus/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "created `ignored-event-message` at `ddb694` (+2 new commits)", 5 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/compare\/0000000000000000000000000000000000000000..ddb694550ebbb7988193f534063456876acf9cb5", 6 | "author": { 7 | "name": "xPaw", 8 | "url": "https:\/\/github.com\/xPaw", 9 | "icon_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3" 10 | }, 11 | "description": "[`ddb694`](https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/ddb694550ebbb7988193f534063456876acf9cb5) Fix event comments and get pull request number without regex\n[`181fcf`](https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/181fcf4d9ddf6d0d50a04d64b0c0d24393c810bf) Add exception message in GitHubIgnoredEventException" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert/discord.json: -------------------------------------------------------------------------------- 1 | { 2 | "embeds": [ 3 | { 4 | "title": "\u26a0 New vulnerability for **rack**", 5 | "url": "https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2018-16470", 6 | "color": 5025616, 7 | "author": { 8 | "name": "github", 9 | "url": "https:\/\/github.com\/github", 10 | "icon_url": "https:\/\/avatars1.githubusercontent.com\/u\/9919?v=4" 11 | }, 12 | "fields": [ 13 | { 14 | "name": "Affected range", 15 | "value": "\\>= 2.0.4, \\< 2.0.6" 16 | }, 17 | { 18 | "name": "Fixed in", 19 | "value": "2.0.6" 20 | }, 21 | { 22 | "name": "Identifier", 23 | "value": "CVE-2018-16470" 24 | } 25 | ] 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Pavel Djundik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /tests/UnknownActionTest.php: -------------------------------------------------------------------------------- 1 | expectException( NotImplementedException::class ); 14 | $this->expectExceptionMessage( 'Unsupported action type "surely_this_action_does_not_exist"' ); 15 | 16 | $Parser = new IrcConverter( $Event, (object)[ 'action' => 'surely_this_action_does_not_exist' ] ); 17 | $Parser->GetMessage(); 18 | } 19 | 20 | /** 21 | * @return array> 22 | */ 23 | public static function eventProvider( ) : array 24 | { 25 | return [ 26 | //[ 'ping' ], // no action 27 | //[ 'push' ], // no action 28 | //[ 'public' ], // no action 29 | [ 'issues' ], 30 | [ 'member' ], 31 | //[ 'gollum' ], // no action 32 | [ 'release' ], 33 | [ 'repository' ], 34 | [ 'pull_request' ], 35 | [ 'issue_comment' ], 36 | [ 'commit_comment' ], 37 | [ 'pull_request_review_comment' ], 38 | ]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/index.php: -------------------------------------------------------------------------------- 1 | ProcessRequest( ); 21 | 22 | if( !$Hook->ValidateHubSignature( GITHUB_SECRET ) ) 23 | { 24 | http_response_code( 401 ); 25 | 26 | exit; 27 | } 28 | 29 | echo 'Received ' . $Hook->GetEventType() . ' in repository ' . $Hook->GetFullRepositoryName() . PHP_EOL; 30 | //var_dump( $Hook->GetPayload() ); 31 | 32 | http_response_code( 202 ); 33 | } 34 | catch( Exception $e ) 35 | { 36 | echo 'Exception: ' . $e->getMessage() . PHP_EOL; 37 | 38 | http_response_code( 500 ); 39 | 40 | exit(); 41 | } 42 | 43 | try 44 | { 45 | $IRC = new IrcConverter( $Hook->GetEventType(), $Hook->GetPayload() ); 46 | 47 | var_dump( $IRC->GetMessage() ); // Optional 48 | 49 | } 50 | catch( Exception $e ) 51 | { 52 | echo 'Exception: ' . $e->getMessage() . PHP_EOL; 53 | 54 | http_response_code( 500 ); 55 | } 56 | -------------------------------------------------------------------------------- /src/BaseConverter.php: -------------------------------------------------------------------------------- 1 | EventType = $EventType; 14 | $this->Payload = $Payload; 15 | 16 | // ref_name is not always available, apparently, we make sure it is 17 | if( !isset( $this->Payload->ref_name ) && isset( $this->Payload->ref ) ) 18 | { 19 | $Ref = explode( '/', $this->Payload->ref, 3 ); 20 | 21 | if( isset( $Ref[ 2 ] ) ) 22 | { 23 | $this->Payload->ref_name = $Ref[ 2 ]; 24 | } 25 | } 26 | 27 | if( !isset( $this->Payload->base_ref_name ) && isset( $this->Payload->base_ref ) ) 28 | { 29 | $Ref = explode( '/', $this->Payload->base_ref, 3 ); 30 | 31 | if( isset( $Ref[ 2 ] ) ) 32 | { 33 | $this->Payload->base_ref_name = $Ref[ 2 ]; 34 | } 35 | } 36 | } 37 | 38 | /** 39 | * Returns distinct commits which have non-empty commit messages. 40 | * 41 | * @return array 42 | */ 43 | protected function GetDistinctCommits( ) : array 44 | { 45 | $Commits = []; 46 | 47 | foreach( $this->Payload->commits as $Commit ) 48 | { 49 | if( isset( $Commit->distinct ) && !$Commit->distinct ) 50 | { 51 | continue; 52 | } 53 | 54 | if( !empty( $Commit->message ) ) 55 | { 56 | $Commits[ ] = $Commit; 57 | } 58 | } 59 | 60 | return $Commits; 61 | } 62 | 63 | protected function BeforeSHA( ) : string 64 | { 65 | return substr( $this->Payload->before, 0, 6 ); 66 | } 67 | 68 | protected function AfterSHA( ) : string 69 | { 70 | return substr( $this->Payload->after, 0, 6 ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /tests/events/ping_org/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "zen": "Design for failure.", 3 | "hook_id": 123, 4 | "hook": { 5 | "type": "Organization", 6 | "id": 123, 7 | "name": "web", 8 | "active": true, 9 | "events": [ 10 | "*" 11 | ], 12 | "config": { 13 | "content_type": "form", 14 | "insecure_ssl": "0", 15 | "secret": "********", 16 | "url": "https://test/" 17 | }, 18 | "updated_at": "2020-11-21T20:54:01Z", 19 | "created_at": "2020-11-21T20:54:01Z", 20 | "url": "https://api.github.com/orgs/SteamDatabase/hooks/123", 21 | "ping_url": "https://api.github.com/orgs/SteamDatabase/hooks/123/pings" 22 | }, 23 | "organization": { 24 | "login": "SteamDatabase", 25 | "id": 3866120, 26 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4NjYxMjA=", 27 | "url": "https://api.github.com/orgs/SteamDatabase", 28 | "repos_url": "https://api.github.com/orgs/SteamDatabase/repos", 29 | "events_url": "https://api.github.com/orgs/SteamDatabase/events", 30 | "hooks_url": "https://api.github.com/orgs/SteamDatabase/hooks", 31 | "issues_url": "https://api.github.com/orgs/SteamDatabase/issues", 32 | "members_url": "https://api.github.com/orgs/SteamDatabase/members{/member}", 33 | "public_members_url": "https://api.github.com/orgs/SteamDatabase/public_members{/member}", 34 | "avatar_url": "https://avatars0.githubusercontent.com/u/3866120?v=4", 35 | "description": "🚰 We occasionally make the pipes leak" 36 | }, 37 | "sender": { 38 | "login": "xPaw", 39 | "id": 613331, 40 | "node_id": "MDQ6VXNlcjYxMzMzMQ==", 41 | "avatar_url": "https://avatars3.githubusercontent.com/u/613331?v=4", 42 | "gravatar_id": "", 43 | "url": "https://api.github.com/users/xPaw", 44 | "html_url": "https://github.com/xPaw", 45 | "followers_url": "https://api.github.com/users/xPaw/followers", 46 | "following_url": "https://api.github.com/users/xPaw/following{/other_user}", 47 | "gists_url": "https://api.github.com/users/xPaw/gists{/gist_id}", 48 | "starred_url": "https://api.github.com/users/xPaw/starred{/owner}{/repo}", 49 | "subscriptions_url": "https://api.github.com/users/xPaw/subscriptions", 50 | "organizations_url": "https://api.github.com/users/xPaw/orgs", 51 | "repos_url": "https://api.github.com/users/xPaw/repos", 52 | "events_url": "https://api.github.com/users/xPaw/events{/privacy}", 53 | "received_events_url": "https://api.github.com/users/xPaw/received_events", 54 | "type": "User", 55 | "site_admin": false 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /tests/EventTest.php: -------------------------------------------------------------------------------- 1 | ProcessRequest( ); 23 | 24 | self::assertEquals( $EventType, $Hook->GetEventType() ); 25 | 26 | // Convert processed event into an irc string 27 | $Parser = new IrcConverter( $Hook->GetEventType(), $Hook->GetPayload() ); 28 | $Message = $Parser->GetMessage(); 29 | 30 | //file_put_contents( $Path . '/expected.bin', $Message . "\n" ); 31 | 32 | self::assertEquals( $ExpectedMessage, $Message, $Path ); 33 | 34 | if( $ExpectedDiscord !== null ) 35 | { 36 | $ExpectedDiscordArray = json_decode( $ExpectedDiscord, true ); 37 | 38 | $Hook->ProcessRequest( ); // parse again because irc formatter can mutate the payload 39 | $Parser = new DiscordConverter( $Hook->GetEventType(), $Hook->GetPayload() ); 40 | $Discord = $Parser->GetEmbed(); 41 | 42 | //file_put_contents( $Path . '/discord.json', json_encode( $Discord, JSON_PRETTY_PRINT ) . "\n" ); 43 | 44 | self::assertEquals( $ExpectedDiscordArray, $Discord, $Path ); 45 | } 46 | } 47 | 48 | /** 49 | * @return array> 50 | */ 51 | public static function eventProvider() : array 52 | { 53 | $ProvidedData = []; 54 | 55 | foreach( new DirectoryIterator( __DIR__ . DIRECTORY_SEPARATOR . 'events' ) as $File ) 56 | { 57 | if( $File->isDot() || !$File->isDir() ) 58 | { 59 | continue; 60 | } 61 | 62 | $Path = $File->getPathname(); 63 | 64 | $ProvidedData[] = 65 | [ 66 | $Path, 67 | trim( (string)file_get_contents( $Path . DIRECTORY_SEPARATOR . 'type.txt' ) ), 68 | trim( (string)file_get_contents( $Path . DIRECTORY_SEPARATOR . 'expected.bin' ) ), 69 | (string)file_get_contents( $Path . DIRECTORY_SEPARATOR . 'payload.json' ), 70 | (string)file_get_contents( $Path . DIRECTORY_SEPARATOR . 'discord.json' ), 71 | ]; 72 | } 73 | 74 | return $ProvidedData; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /tests/IgnoredActionsThrowTest.php: -------------------------------------------------------------------------------- 1 | expectException( IgnoredEventException::class ); 14 | 15 | $Parser = new IrcConverter( 'issues', (object)[ 'action' => $Action ] ); 16 | $Parser->GetMessage(); 17 | } 18 | 19 | #[DataProvider('ignoredPullRequestActionProvider')] 20 | public function testPullRequestThrow( string $Action ) : void 21 | { 22 | $this->expectException( IgnoredEventException::class ); 23 | 24 | $Parser = new IrcConverter( 'pull_request', (object)[ 'action' => $Action ] ); 25 | $Parser->GetMessage(); 26 | } 27 | 28 | #[DataProvider('ignoredPullRequestReviewActionProvider')] 29 | public function testPullRequestReviewThrow( string $Action ) : void 30 | { 31 | $this->expectException( IgnoredEventException::class ); 32 | 33 | $Parser = new IrcConverter( 'pull_request_review', (object)[ 'action' => 'submitted', 'review' => (object)[ 'state' => $Action ] ] ); 34 | $Parser->GetMessage(); 35 | } 36 | 37 | #[DataProvider('ignoredMilestoneActionProvider')] 38 | public function testMilestoneThrow( string $Action ) : void 39 | { 40 | $this->expectException( IgnoredEventException::class ); 41 | 42 | $Parser = new IrcConverter( 'milestone', (object)[ 'action' => $Action ] ); 43 | $Parser->GetMessage(); 44 | } 45 | 46 | /** 47 | * @return array> 48 | */ 49 | public static function ignoredIssueActionProvider( ) : array 50 | { 51 | return [ 52 | [ 'labeled' ], 53 | [ 'unlabeled' ], 54 | [ 'assigned' ], 55 | [ 'unassigned' ], 56 | ]; 57 | } 58 | 59 | /** 60 | * @return array> 61 | */ 62 | public static function ignoredPullRequestActionProvider( ) : array 63 | { 64 | return [ 65 | [ 'synchronize' ], 66 | [ 'labeled' ], 67 | [ 'unlabeled' ], 68 | [ 'assigned' ], 69 | [ 'unassigned' ], 70 | [ 'review_requested' ], 71 | [ 'review_request_removed' ], 72 | ]; 73 | } 74 | 75 | /** 76 | * @return array> 77 | */ 78 | public static function ignoredPullRequestReviewActionProvider( ) : array 79 | { 80 | return [ 81 | [ 'commented' ], 82 | ]; 83 | } 84 | 85 | /** 86 | * @return array> 87 | */ 88 | public static function ignoredMilestoneActionProvider( ) : array 89 | { 90 | return [ 91 | [ 'edited' ], 92 | ]; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /examples/discord.php: -------------------------------------------------------------------------------- 1 | ValidateHubSignature( GITHUB_SECRET ) ) 27 | { 28 | throw new Exception( 'Secret validation failed.' ); 29 | } 30 | 31 | $Hook->ProcessRequest( ); 32 | 33 | $RepositoryName = $Hook->GetFullRepositoryName(); 34 | 35 | echo 'Received ' . $Hook->GetEventType() . ' in repository ' . $RepositoryName . PHP_EOL; 36 | //print_r( $Hook->GetPayload() ); 37 | 38 | // Format Discord message 39 | $DiscordConverter = new DiscordConverter( $Hook->GetEventType(), $Hook->GetPayload() ); 40 | $DiscordMessage = $DiscordConverter->GetEmbed(); 41 | 42 | if( empty( $DiscordMessage ) ) 43 | { 44 | throw new Exception( 'Empty message, not sending.' ); 45 | } 46 | 47 | foreach( $DiscordWebhooks as $Channel => $SendTargets ) 48 | { 49 | if( !wild( $RepositoryName, $Channel ) ) 50 | { 51 | continue; 52 | } 53 | 54 | echo 'Matched "' . $RepositoryName . '" as "' . $Channel . '"' . PHP_EOL; 55 | 56 | foreach( $SendTargets as $Target ) 57 | { 58 | SendToDiscord( $Target, $DiscordMessage ); 59 | } 60 | } 61 | 62 | echo 'Payload sent to Discord' . PHP_EOL; 63 | 64 | http_response_code( 202 ); 65 | } 66 | catch( IgnoredEventException $e ) 67 | { 68 | http_response_code( 200 ); 69 | 70 | echo 'This GitHub event is ignored.'; 71 | } 72 | catch( NotImplementedException $e ) 73 | { 74 | http_response_code( 501 ); 75 | 76 | echo 'Unsupported GitHub event: ' . $e->EventName; 77 | } 78 | catch( Exception $e ) 79 | { 80 | echo 'Exception: ' . $e->getMessage() . PHP_EOL; 81 | } 82 | 83 | function wild( string $string, string $expression ) : bool 84 | { 85 | if( strpos( $expression, '*' ) === false ) 86 | { 87 | return strcmp( $expression, $string ) === 0; 88 | } 89 | 90 | $expression = preg_quote( $expression, '/' ); 91 | $expression = str_replace( '\*', '.*', $expression ); 92 | 93 | return preg_match( '/^' . $expression . '$/', $string ) === 1; 94 | } 95 | 96 | function SendToDiscord( string $Url, array $Payload ) : bool 97 | { 98 | $c = curl_init( ); 99 | curl_setopt_array( $c, [ 100 | CURLOPT_USERAGENT => 'https://github.com/xPaw/GitHub-WebHook', 101 | CURLOPT_RETURNTRANSFER => true, 102 | CURLOPT_FOLLOWLOCATION => 0, 103 | CURLOPT_TIMEOUT => 30, 104 | CURLOPT_CONNECTTIMEOUT => 30, 105 | CURLOPT_URL => $Url, 106 | CURLOPT_POST => true, 107 | CURLOPT_POSTFIELDS => json_encode( $Payload ), 108 | CURLOPT_HTTPHEADER => [ 109 | 'Content-Type: application/json', 110 | ], 111 | ] ); 112 | curl_exec( $c ); 113 | $Code = curl_getinfo( $c, CURLINFO_HTTP_CODE ); 114 | curl_close( $c ); 115 | 116 | echo 'Discord HTTP ' . $Code . PHP_EOL; 117 | 118 | return $Code >= 200 && $Code < 300; 119 | } 120 | -------------------------------------------------------------------------------- /examples/irker.php: -------------------------------------------------------------------------------- 1 | ValidateHubSignature( GITHUB_SECRET ) ) 27 | { 28 | throw new Exception( 'Secret validation failed.' ); 29 | } 30 | 31 | $Hook->ProcessRequest( ); 32 | 33 | $RepositoryName = $Hook->GetFullRepositoryName(); 34 | 35 | echo 'Received ' . $Hook->GetEventType() . ' in repository ' . $RepositoryName . PHP_EOL; 36 | //print_r( $Hook->GetPayload() ); 37 | 38 | // Format IRC message 39 | $IRC = new IrcConverter( $Hook->GetEventType(), $Hook->GetPayload() ); 40 | $Message = $IRC->GetMessage(); 41 | 42 | if( isset( $_GET[ 'strip_colors' ] ) ) 43 | { 44 | $Message = strip_colors( $Message ); 45 | } 46 | 47 | if( empty( $Message ) ) 48 | { 49 | throw new Exception( 'Empty message, not sending.' ); 50 | } 51 | 52 | // Format irker payload 53 | $IrkerPayload = ''; 54 | 55 | foreach( $Channels as $Channel => $SendTargets ) 56 | { 57 | if( !wild( $RepositoryName, $Channel ) ) 58 | { 59 | continue; 60 | } 61 | 62 | echo 'Matched "' . $RepositoryName . '" as "' . $Channel . '"' . PHP_EOL; 63 | 64 | foreach( $SendTargets as $Target ) 65 | { 66 | $IrkerPayload .= json_encode( Array( 67 | 'to' => $Target, 68 | 'privmsg' => $Message 69 | ) ) . "\n"; 70 | } 71 | } 72 | 73 | if( empty( $IrkerPayload ) ) 74 | { 75 | throw new Exception( 'Empty payload, not sending.' ); 76 | } 77 | 78 | // Send to irker 79 | $Socket = socket_create( AF_INET, SOCK_STREAM, SOL_TCP ); 80 | 81 | if( $Socket === false 82 | || socket_connect( $Socket, IRKER_HOST, IRKER_PORT ) === false 83 | || socket_write( $Socket, $IrkerPayload ) === false ) 84 | { 85 | throw new Exception( 'Socket error: ' . socket_strerror( socket_last_error() ) ); 86 | } 87 | 88 | echo 'Payload sent to irker' . PHP_EOL . $IrkerPayload . PHP_EOL; 89 | 90 | http_response_code( 202 ); 91 | } 92 | catch( IgnoredEventException $e ) 93 | { 94 | http_response_code( 200 ); 95 | 96 | echo 'This GitHub event is ignored.'; 97 | } 98 | catch( NotImplementedException $e ) 99 | { 100 | http_response_code( 501 ); 101 | 102 | echo 'Unsupported GitHub event: ' . $e->EventName; 103 | } 104 | catch( Exception $e ) 105 | { 106 | echo 'Exception: ' . $e->getMessage() . PHP_EOL; 107 | } 108 | 109 | // Cleanup 110 | if( $Socket !== false ) 111 | { 112 | socket_close( $Socket ); 113 | } 114 | 115 | function wild( string $string, string $expression ) : bool 116 | { 117 | if( strpos( $expression, '*' ) === false ) 118 | { 119 | return strcmp( $expression, $string ) === 0; 120 | } 121 | 122 | $expression = preg_quote( $expression, '/' ); 123 | $expression = str_replace( '\*', '.*', $expression ); 124 | 125 | return preg_match( '/^' . $expression . '$/', $string ) === 1; 126 | } 127 | 128 | function strip_colors( string $message ) : string 129 | { 130 | return preg_replace( "/\x03(\d\d)?/", '', $message ) ?? $message; 131 | } 132 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This script acts as a web hook for [GitHub](https://github.com/) events, processes them, 2 | and returns messages which can be sent out to an IRC channel or a Discord webhook, 3 | depending on the converter used. 4 | 5 | See `examples/discord.php` for a basic application that sends webhooks to Discord. 6 | See `examples/irker.php` for a basic application that sends messages to IRC. 7 | 8 | ## GitHubWebHook 9 | `GitHubWebHook.php` accepts, processes and validates an event, 10 | it also can make sure that the event came from a GitHub server. 11 | 12 | Functions in this class are: 13 | 14 | #### ProcessRequest() 15 | Accepts an event, throws `Exception` on error. 16 | 17 | #### GetEventType() 18 | Returns event type. 19 | See https://developer.github.com/webhooks/#events for a list of events. 20 | 21 | #### GetPayload() 22 | Returns decoded JSON payload as an object. 23 | 24 | #### GetFullRepositoryName() 25 | Returns full name of the repository for which an event was sent for. 26 | 27 | #### ValidateHubSignature( $SecretKey ) 28 | Retuns true if HMAC hex digest of the payload matches GitHub's, false otherwise. 29 | 30 | ## IrcConverter 31 | `IrcConverter.php` accepts input from previous script and outputs 32 | a colored string which can be sent to IRC. 33 | 34 | #### __construct( $EventType, $Payload ) 35 | `IrcConverter` constructor takes 3 paramaters (last one is optional). 36 | All you need to do is pass data after parsing the message with `GitHubWebHook` 37 | like so: `new IrcConverter( $Hook->GetEventType(), $Hook->GetPayload() );` 38 | 39 | URL shortener paramater takes a function, and that function should accept 40 | a single string argument containing an url. If your function fails to 41 | shorten an url or do anything with it, your function must return the 42 | original url back. 43 | 44 | #### GetMessage() 45 | After calling the constructor, using this function will return 46 | a string which can be sent to an IRC server. 47 | 48 | Throws `NotImplementedException` when you pass an event that 49 | is not parsed anyhow, and throws `IgnoredEventException` for 50 | `fork`, `watch` and `status` events which are ignored by design. 51 | 52 | ## Events [\[ref\]](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads) 53 | 54 | Track changes to GitHub webhook payloads documentation here: https://github.com/github/docs/commits/main/data/reusables/webhooks 55 | 56 | ### Supported events 57 | 58 | - commit_comment 59 | - delete 60 | - discussion 61 | - discussion_comment 62 | - gollum 63 | - issue_comment 64 | - issues 65 | - member 66 | - milestone 67 | - package 68 | - ping 69 | - project 70 | - public 71 | - pull_request 72 | - pull_request_review 73 | - pull_request_review_comment 74 | - push 75 | - release 76 | - repository 77 | - repository_vulnerability_alert 78 | 79 | ### Not yet supported events 80 | 81 | - check_run 82 | - check_suite 83 | - code_scanning_alert 84 | - deploy_key 85 | - deployment 86 | - deployment_status 87 | - label 88 | - membership 89 | - meta 90 | - org_block 91 | - organization 92 | - page_build 93 | - project_card 94 | - project_column 95 | - repository_import 96 | - sponsorship 97 | - team 98 | - team_add 99 | 100 | ### Events ignored by design 101 | 102 | - create - Formatted from push event instead 103 | - fork 104 | - star 105 | - status 106 | - watch 107 | 108 | Additionally, events like labelling or assigning an issue are also ignored. 109 | Push event ignores branch deletions (use delete event instead). 110 | 111 | ### Events that can not be supported 112 | 113 | - content_reference 114 | - github_app_authorization 115 | - installation 116 | - installation_repositories 117 | - marketplace_purchase 118 | - repository_dispatch 119 | - security_advisory 120 | - workflow_dispatch 121 | - workflow_run 122 | 123 | ## License 124 | [MIT](LICENSE) 125 | -------------------------------------------------------------------------------- /src/GitHubWebHook.php: -------------------------------------------------------------------------------- 1 | EventType = $_SERVER[ 'HTTP_X_GITHUB_EVENT' ]; 24 | 25 | if ( preg_match( '/^[a-z_]+$/', $this->EventType ) !== 1 ) 26 | { 27 | throw new Exception( 'Invalid event header.' ); 28 | } 29 | 30 | if( !array_key_exists( 'REQUEST_METHOD', $_SERVER ) || $_SERVER[ 'REQUEST_METHOD' ] !== 'POST' ) 31 | { 32 | throw new Exception( 'Invalid request method.' ); 33 | } 34 | 35 | if( !array_key_exists( 'CONTENT_TYPE', $_SERVER ) ) 36 | { 37 | throw new Exception( 'Missing content type.' ); 38 | } 39 | 40 | $ContentType = $_SERVER[ 'CONTENT_TYPE' ]; 41 | 42 | if( $ContentType === 'application/x-www-form-urlencoded' ) 43 | { 44 | if( !array_key_exists( 'payload', $_POST ) ) 45 | { 46 | throw new Exception( 'Missing payload.' ); 47 | } 48 | 49 | $RawPayload = $_POST[ 'payload' ]; 50 | } 51 | else if( $ContentType === 'application/json' ) 52 | { 53 | $RawPayload = file_get_contents( 'php://input' ); 54 | } 55 | else 56 | { 57 | throw new Exception( 'Unknown content type.' ); 58 | } 59 | 60 | $Decoded = json_decode( $RawPayload ); 61 | 62 | if( !is_object( $Decoded ) ) 63 | { 64 | throw new Exception( 'Failed to decode JSON: ' . 65 | ( function_exists( 'json_last_error_msg' ) ? json_last_error_msg() : json_last_error() ) 66 | ); 67 | } 68 | 69 | $this->Payload = $Decoded; 70 | 71 | if( !isset( $this->Payload->repository ) ) 72 | { 73 | if( !isset( $this->Payload->organization ) ) 74 | { 75 | throw new Exception( 'Missing repository information.' ); 76 | } 77 | 78 | // This is a silly hack to handle org-only events 79 | $this->Payload->repository = (object)[ 80 | // Add "/repositories" because repo matching code would expect a "/" format 81 | 'full_name' => $this->Payload->organization->login . '/repositories', 82 | 'name' => 'org: ' . $this->Payload->organization->login, 83 | 'owner' => (object)[ 84 | 'name' => $this->Payload->organization->login, 85 | 'login' => $this->Payload->organization->login, 86 | ], 87 | ]; 88 | } 89 | 90 | return true; 91 | } 92 | 93 | /** 94 | * Optional function to check if HMAC hex digest of the payload matches GitHub's. 95 | */ 96 | public function ValidateHubSignature( string $SecretKey ) : bool 97 | { 98 | if( !array_key_exists( 'HTTP_X_HUB_SIGNATURE_256', $_SERVER ) ) 99 | { 100 | throw new Exception( 'Missing X-Hub-Signature-256 header. Did you configure secret token in hook settings?' ); 101 | } 102 | 103 | $Payload = file_get_contents( 'php://input' ); 104 | 105 | if( $Payload === false ) 106 | { 107 | throw new Exception( 'Failed to read php://input.' ); 108 | } 109 | 110 | $KnownAlgo = 'sha256'; 111 | $CalculatedHash = $KnownAlgo . '=' . hash_hmac( $KnownAlgo, $Payload, $SecretKey, false ); 112 | 113 | return hash_equals( $CalculatedHash, $_SERVER[ 'HTTP_X_HUB_SIGNATURE_256' ] ); 114 | } 115 | 116 | /** 117 | * Returns event type. 118 | * 119 | * @see https://developer.github.com/webhooks/#events 120 | */ 121 | public function GetEventType( ) : string 122 | { 123 | return $this->EventType; 124 | } 125 | 126 | /** 127 | * Returns decoded payload. 128 | */ 129 | public function GetPayload( ) : object 130 | { 131 | return $this->Payload; 132 | } 133 | 134 | /** 135 | * Returns full name of the repository. 136 | */ 137 | public function GetFullRepositoryName( ) : string 138 | { 139 | return $this->Payload->repository->full_name ?? sprintf( '%s/%s', $this->Payload->repository->owner->name, $this->Payload->repository->name ); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /tests/events/delete/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "simple-tag", 3 | "ref_type": "tag", 4 | "pusher_type": "user", 5 | "repository": { 6 | "id": 186853002, 7 | "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", 8 | "name": "Hello-World", 9 | "full_name": "Codertocat/Hello-World", 10 | "private": false, 11 | "owner": { 12 | "login": "Codertocat", 13 | "id": 21031067, 14 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 15 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 16 | "gravatar_id": "", 17 | "url": "https://api.github.com/users/Codertocat", 18 | "html_url": "https://github.com/Codertocat", 19 | "followers_url": "https://api.github.com/users/Codertocat/followers", 20 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 21 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 22 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 23 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 24 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 25 | "repos_url": "https://api.github.com/users/Codertocat/repos", 26 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 27 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 28 | "type": "User", 29 | "site_admin": false 30 | }, 31 | "html_url": "https://github.com/Codertocat/Hello-World", 32 | "description": null, 33 | "fork": false, 34 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 35 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 36 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 37 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 38 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 39 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 40 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 41 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 42 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 43 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 44 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 45 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 46 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 47 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 48 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 49 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 50 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 51 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 52 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 53 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 54 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 55 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 56 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 57 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 58 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 59 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 60 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 61 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 62 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 63 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 64 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 65 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 66 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 67 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 68 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 69 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 70 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 71 | "created_at": "2019-05-15T15:19:25Z", 72 | "updated_at": "2019-05-15T15:20:41Z", 73 | "pushed_at": "2019-05-15T15:20:57Z", 74 | "git_url": "git://github.com/Codertocat/Hello-World.git", 75 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 76 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 77 | "svn_url": "https://github.com/Codertocat/Hello-World", 78 | "homepage": null, 79 | "size": 0, 80 | "stargazers_count": 0, 81 | "watchers_count": 0, 82 | "language": "Ruby", 83 | "has_issues": true, 84 | "has_projects": true, 85 | "has_downloads": true, 86 | "has_wiki": true, 87 | "has_pages": true, 88 | "forks_count": 1, 89 | "mirror_url": null, 90 | "archived": false, 91 | "disabled": false, 92 | "open_issues_count": 2, 93 | "license": null, 94 | "forks": 1, 95 | "open_issues": 2, 96 | "watchers": 0, 97 | "default_branch": "master" 98 | }, 99 | "sender": { 100 | "login": "Codertocat", 101 | "id": 21031067, 102 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 103 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 104 | "gravatar_id": "", 105 | "url": "https://api.github.com/users/Codertocat", 106 | "html_url": "https://github.com/Codertocat", 107 | "followers_url": "https://api.github.com/users/Codertocat/followers", 108 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 109 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 110 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 111 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 112 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 113 | "repos_url": "https://api.github.com/users/Codertocat/repos", 114 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 115 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 116 | "type": "User", 117 | "site_admin": false 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /tests/events/public/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "repository": { 3 | "id": 51690903, 4 | "name": "new-private-repository", 5 | "full_name": "xPaw\/new-private-repository", 6 | "owner": { 7 | "login": "xPaw", 8 | "id": 613331, 9 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 10 | "gravatar_id": "", 11 | "url": "https:\/\/api.github.com\/users\/xPaw", 12 | "html_url": "https:\/\/github.com\/xPaw", 13 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 14 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 15 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 16 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 17 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 18 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 19 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 20 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 21 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 22 | "type": "User", 23 | "site_admin": false 24 | }, 25 | "private": false, 26 | "html_url": "https:\/\/github.com\/xPaw\/new-private-repository", 27 | "description": "", 28 | "fork": false, 29 | "url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository", 30 | "forks_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/forks", 31 | "keys_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/keys{\/key_id}", 32 | "collaborators_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/collaborators{\/collaborator}", 33 | "teams_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/teams", 34 | "hooks_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/hooks", 35 | "issue_events_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/issues\/events{\/number}", 36 | "events_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/events", 37 | "assignees_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/assignees{\/user}", 38 | "branches_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/branches{\/branch}", 39 | "tags_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/tags", 40 | "blobs_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/git\/blobs{\/sha}", 41 | "git_tags_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/git\/tags{\/sha}", 42 | "git_refs_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/git\/refs{\/sha}", 43 | "trees_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/git\/trees{\/sha}", 44 | "statuses_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/statuses\/{sha}", 45 | "languages_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/languages", 46 | "stargazers_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/stargazers", 47 | "contributors_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/contributors", 48 | "subscribers_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/subscribers", 49 | "subscription_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/subscription", 50 | "commits_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/commits{\/sha}", 51 | "git_commits_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/git\/commits{\/sha}", 52 | "comments_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/comments{\/number}", 53 | "issue_comment_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/issues\/comments{\/number}", 54 | "contents_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/contents\/{+path}", 55 | "compare_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/compare\/{base}...{head}", 56 | "merges_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/merges", 57 | "archive_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/{archive_format}{\/ref}", 58 | "downloads_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/downloads", 59 | "issues_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/issues{\/number}", 60 | "pulls_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/pulls{\/number}", 61 | "milestones_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/milestones{\/number}", 62 | "notifications_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/notifications{?since,all,participating}", 63 | "labels_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/labels{\/name}", 64 | "releases_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/releases{\/id}", 65 | "deployments_url": "https:\/\/api.github.com\/repos\/xPaw\/new-private-repository\/deployments", 66 | "created_at": "2016-02-14T10:50:50Z", 67 | "updated_at": "2016-02-14T10:51:10Z", 68 | "pushed_at": "2016-02-14T10:50:50Z", 69 | "git_url": "git:\/\/github.com\/xPaw\/new-private-repository.git", 70 | "ssh_url": "git@github.com:xPaw\/new-private-repository.git", 71 | "clone_url": "https:\/\/github.com\/xPaw\/new-private-repository.git", 72 | "svn_url": "https:\/\/github.com\/xPaw\/new-private-repository", 73 | "homepage": null, 74 | "size": 0, 75 | "stargazers_count": 0, 76 | "watchers_count": 0, 77 | "language": null, 78 | "has_issues": true, 79 | "has_downloads": true, 80 | "has_wiki": true, 81 | "has_pages": false, 82 | "forks_count": 0, 83 | "mirror_url": null, 84 | "open_issues_count": 0, 85 | "forks": 0, 86 | "open_issues": 0, 87 | "watchers": 0, 88 | "default_branch": "master" 89 | }, 90 | "sender": { 91 | "login": "xPaw", 92 | "id": 613331, 93 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 94 | "gravatar_id": "", 95 | "url": "https:\/\/api.github.com\/users\/xPaw", 96 | "html_url": "https:\/\/github.com\/xPaw", 97 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 98 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 99 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 100 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 101 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 102 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 103 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 104 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 105 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 106 | "type": "User", 107 | "site_admin": false 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "create", 3 | "alert": { 4 | "id": 91095730, 5 | "affected_range": ">= 2.0.4, < 2.0.6", 6 | "affected_package_name": "rack", 7 | "external_reference": "https://nvd.nist.gov/vuln/detail/CVE-2018-16470", 8 | "external_identifier": "CVE-2018-16470", 9 | "fixed_in": "2.0.6" 10 | }, 11 | "repository": { 12 | "id": 186853002, 13 | "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", 14 | "name": "Hello-World", 15 | "full_name": "Codertocat/Hello-World", 16 | "private": false, 17 | "owner": { 18 | "login": "Codertocat", 19 | "id": 21031067, 20 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 21 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 22 | "gravatar_id": "", 23 | "url": "https://api.github.com/users/Codertocat", 24 | "html_url": "https://github.com/Codertocat", 25 | "followers_url": "https://api.github.com/users/Codertocat/followers", 26 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 27 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 28 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 29 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 30 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 31 | "repos_url": "https://api.github.com/users/Codertocat/repos", 32 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 33 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 34 | "type": "User", 35 | "site_admin": false 36 | }, 37 | "html_url": "https://github.com/Codertocat/Hello-World", 38 | "description": null, 39 | "fork": false, 40 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 41 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 42 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 43 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 44 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 45 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 46 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 47 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 48 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 49 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 50 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 51 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 52 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 53 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 54 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 55 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 56 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 57 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 58 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 59 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 60 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 61 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 62 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 63 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 64 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 65 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 66 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 67 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 68 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 69 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 70 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 71 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 72 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 73 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 74 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 75 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 76 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 77 | "created_at": "2019-05-15T15:19:25Z", 78 | "updated_at": "2019-05-15T15:19:27Z", 79 | "pushed_at": "2019-05-15T15:20:32Z", 80 | "git_url": "git://github.com/Codertocat/Hello-World.git", 81 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 82 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 83 | "svn_url": "https://github.com/Codertocat/Hello-World", 84 | "homepage": null, 85 | "size": 0, 86 | "stargazers_count": 0, 87 | "watchers_count": 0, 88 | "language": null, 89 | "has_issues": true, 90 | "has_projects": true, 91 | "has_downloads": true, 92 | "has_wiki": true, 93 | "has_pages": true, 94 | "forks_count": 0, 95 | "mirror_url": null, 96 | "archived": false, 97 | "disabled": false, 98 | "open_issues_count": 2, 99 | "license": null, 100 | "forks": 0, 101 | "open_issues": 2, 102 | "watchers": 0, 103 | "default_branch": "master" 104 | }, 105 | "sender": { 106 | "login": "github", 107 | "id": 9919, 108 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", 109 | "avatar_url": "https://avatars1.githubusercontent.com/u/9919?v=4", 110 | "gravatar_id": "", 111 | "url": "https://api.github.com/users/github", 112 | "html_url": "https://github.com/github", 113 | "followers_url": "https://api.github.com/users/github/followers", 114 | "following_url": "https://api.github.com/users/github/following{/other_user}", 115 | "gists_url": "https://api.github.com/users/github/gists{/gist_id}", 116 | "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", 117 | "subscriptions_url": "https://api.github.com/users/github/subscriptions", 118 | "organizations_url": "https://api.github.com/users/github/orgs", 119 | "repos_url": "https://api.github.com/users/github/repos", 120 | "events_url": "https://api.github.com/users/github/events{/privacy}", 121 | "received_events_url": "https://api.github.com/users/github/received_events", 122 | "type": "Organization", 123 | "site_admin": false 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_dismiss/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "dismiss", 3 | "alert": { 4 | "id": 91095730, 5 | "affected_range": ">= 2.0.4, < 2.0.6", 6 | "affected_package_name": "rack", 7 | "external_reference": "https://nvd.nist.gov/vuln/detail/CVE-2018-16470", 8 | "external_identifier": "CVE-2018-16470", 9 | "fixed_in": "2.0.6" 10 | }, 11 | "repository": { 12 | "id": 186853002, 13 | "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", 14 | "name": "Hello-World", 15 | "full_name": "Codertocat/Hello-World", 16 | "private": false, 17 | "owner": { 18 | "login": "Codertocat", 19 | "id": 21031067, 20 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 21 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 22 | "gravatar_id": "", 23 | "url": "https://api.github.com/users/Codertocat", 24 | "html_url": "https://github.com/Codertocat", 25 | "followers_url": "https://api.github.com/users/Codertocat/followers", 26 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 27 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 28 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 29 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 30 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 31 | "repos_url": "https://api.github.com/users/Codertocat/repos", 32 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 33 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 34 | "type": "User", 35 | "site_admin": false 36 | }, 37 | "html_url": "https://github.com/Codertocat/Hello-World", 38 | "description": null, 39 | "fork": false, 40 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 41 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 42 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 43 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 44 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 45 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 46 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 47 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 48 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 49 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 50 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 51 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 52 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 53 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 54 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 55 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 56 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 57 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 58 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 59 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 60 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 61 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 62 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 63 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 64 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 65 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 66 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 67 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 68 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 69 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 70 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 71 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 72 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 73 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 74 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 75 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 76 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 77 | "created_at": "2019-05-15T15:19:25Z", 78 | "updated_at": "2019-05-15T15:19:27Z", 79 | "pushed_at": "2019-05-15T15:20:32Z", 80 | "git_url": "git://github.com/Codertocat/Hello-World.git", 81 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 82 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 83 | "svn_url": "https://github.com/Codertocat/Hello-World", 84 | "homepage": null, 85 | "size": 0, 86 | "stargazers_count": 0, 87 | "watchers_count": 0, 88 | "language": null, 89 | "has_issues": true, 90 | "has_projects": true, 91 | "has_downloads": true, 92 | "has_wiki": true, 93 | "has_pages": true, 94 | "forks_count": 0, 95 | "mirror_url": null, 96 | "archived": false, 97 | "disabled": false, 98 | "open_issues_count": 2, 99 | "license": null, 100 | "forks": 0, 101 | "open_issues": 2, 102 | "watchers": 0, 103 | "default_branch": "master" 104 | }, 105 | "sender": { 106 | "login": "github", 107 | "id": 9919, 108 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", 109 | "avatar_url": "https://avatars1.githubusercontent.com/u/9919?v=4", 110 | "gravatar_id": "", 111 | "url": "https://api.github.com/users/github", 112 | "html_url": "https://github.com/github", 113 | "followers_url": "https://api.github.com/users/github/followers", 114 | "following_url": "https://api.github.com/users/github/following{/other_user}", 115 | "gists_url": "https://api.github.com/users/github/gists{/gist_id}", 116 | "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", 117 | "subscriptions_url": "https://api.github.com/users/github/subscriptions", 118 | "organizations_url": "https://api.github.com/users/github/orgs", 119 | "repos_url": "https://api.github.com/users/github/repos", 120 | "events_url": "https://api.github.com/users/github/events{/privacy}", 121 | "received_events_url": "https://api.github.com/users/github/received_events", 122 | "type": "Organization", 123 | "site_admin": false 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /tests/events/repository_vulnerability_alert_resolve/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "resolve", 3 | "alert": { 4 | "id": 91095730, 5 | "affected_range": ">= 2.0.4, < 2.0.6", 6 | "affected_package_name": "rack", 7 | "external_reference": "https://nvd.nist.gov/vuln/detail/CVE-2018-16470", 8 | "external_identifier": "CVE-2018-16470", 9 | "fixed_in": "2.0.6" 10 | }, 11 | "repository": { 12 | "id": 186853002, 13 | "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", 14 | "name": "Hello-World", 15 | "full_name": "Codertocat/Hello-World", 16 | "private": false, 17 | "owner": { 18 | "login": "Codertocat", 19 | "id": 21031067, 20 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 21 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 22 | "gravatar_id": "", 23 | "url": "https://api.github.com/users/Codertocat", 24 | "html_url": "https://github.com/Codertocat", 25 | "followers_url": "https://api.github.com/users/Codertocat/followers", 26 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 27 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 28 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 29 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 30 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 31 | "repos_url": "https://api.github.com/users/Codertocat/repos", 32 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 33 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 34 | "type": "User", 35 | "site_admin": false 36 | }, 37 | "html_url": "https://github.com/Codertocat/Hello-World", 38 | "description": null, 39 | "fork": false, 40 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 41 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 42 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 43 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 44 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 45 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 46 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 47 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 48 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 49 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 50 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 51 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 52 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 53 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 54 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 55 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 56 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 57 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 58 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 59 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 60 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 61 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 62 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 63 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 64 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 65 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 66 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 67 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 68 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 69 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 70 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 71 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 72 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 73 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 74 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 75 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 76 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 77 | "created_at": "2019-05-15T15:19:25Z", 78 | "updated_at": "2019-05-15T15:19:27Z", 79 | "pushed_at": "2019-05-15T15:20:32Z", 80 | "git_url": "git://github.com/Codertocat/Hello-World.git", 81 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 82 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 83 | "svn_url": "https://github.com/Codertocat/Hello-World", 84 | "homepage": null, 85 | "size": 0, 86 | "stargazers_count": 0, 87 | "watchers_count": 0, 88 | "language": null, 89 | "has_issues": true, 90 | "has_projects": true, 91 | "has_downloads": true, 92 | "has_wiki": true, 93 | "has_pages": true, 94 | "forks_count": 0, 95 | "mirror_url": null, 96 | "archived": false, 97 | "disabled": false, 98 | "open_issues_count": 2, 99 | "license": null, 100 | "forks": 0, 101 | "open_issues": 2, 102 | "watchers": 0, 103 | "default_branch": "master" 104 | }, 105 | "sender": { 106 | "login": "github", 107 | "id": 9919, 108 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", 109 | "avatar_url": "https://avatars1.githubusercontent.com/u/9919?v=4", 110 | "gravatar_id": "", 111 | "url": "https://api.github.com/users/github", 112 | "html_url": "https://github.com/github", 113 | "followers_url": "https://api.github.com/users/github/followers", 114 | "following_url": "https://api.github.com/users/github/following{/other_user}", 115 | "gists_url": "https://api.github.com/users/github/gists{/gist_id}", 116 | "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", 117 | "subscriptions_url": "https://api.github.com/users/github/subscriptions", 118 | "organizations_url": "https://api.github.com/users/github/orgs", 119 | "repos_url": "https://api.github.com/users/github/repos", 120 | "events_url": "https://api.github.com/users/github/events{/privacy}", 121 | "received_events_url": "https://api.github.com/users/github/received_events", 122 | "type": "Organization", 123 | "site_admin": false 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /tests/events/push_created/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "refs\/heads\/hello-world", 3 | "before": "0000000000000000000000000000000000000000", 4 | "after": "a192fe8a896a1547fa6d7a607d4b0b78c5fa7909", 5 | "created": true, 6 | "deleted": false, 7 | "forced": true, 8 | "base_ref": "refs\/heads\/master", 9 | "compare": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/compare\/hello-world", 10 | "commits": [], 11 | "head_commit": { 12 | "id": "a192fe8a896a1547fa6d7a607d4b0b78c5fa7909", 13 | "distinct": true, 14 | "message": "Add tests for gollum and issue opened events", 15 | "timestamp": "2016-02-13T21:04:12+02:00", 16 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/a192fe8a896a1547fa6d7a607d4b0b78c5fa7909", 17 | "author": { 18 | "name": "Pavel Djundik", 19 | "email": "xPaw@users.noreply.github.com", 20 | "username": "xPaw" 21 | }, 22 | "committer": { 23 | "name": "Pavel Djundik", 24 | "email": "xPaw@users.noreply.github.com", 25 | "username": "xPaw" 26 | }, 27 | "added": [ 28 | "tests\/events\/gollum\/expected.bin", 29 | "tests\/events\/gollum\/payload.json", 30 | "tests\/events\/gollum\/type.txt", 31 | "tests\/events\/issue_opened\/expected.bin", 32 | "tests\/events\/issue_opened\/payload.json", 33 | "tests\/events\/issue_opened\/type.txt" 34 | ], 35 | "removed": [], 36 | "modified": [] 37 | }, 38 | "repository": { 39 | "id": 17406648, 40 | "name": "GitHub-WebHook", 41 | "full_name": "xPaw\/GitHub-WebHook", 42 | "owner": { 43 | "name": "xPaw", 44 | "email": "xPaw@users.noreply.github.com" 45 | }, 46 | "private": false, 47 | "html_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 48 | "description": ":octocat: Validates and processes GitHub's webhooks", 49 | "fork": false, 50 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 51 | "forks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/forks", 52 | "keys_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/keys{\/key_id}", 53 | "collaborators_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/collaborators{\/collaborator}", 54 | "teams_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/teams", 55 | "hooks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks", 56 | "issue_events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/events{\/number}", 57 | "events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/events", 58 | "assignees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/assignees{\/user}", 59 | "branches_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/branches{\/branch}", 60 | "tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/tags", 61 | "blobs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/blobs{\/sha}", 62 | "git_tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/tags{\/sha}", 63 | "git_refs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/refs{\/sha}", 64 | "trees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/trees{\/sha}", 65 | "statuses_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/statuses\/{sha}", 66 | "languages_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/languages", 67 | "stargazers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/stargazers", 68 | "contributors_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contributors", 69 | "subscribers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscribers", 70 | "subscription_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscription", 71 | "commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/commits{\/sha}", 72 | "git_commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/commits{\/sha}", 73 | "comments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/comments{\/number}", 74 | "issue_comment_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/comments{\/number}", 75 | "contents_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contents\/{+path}", 76 | "compare_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/compare\/{base}...{head}", 77 | "merges_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/merges", 78 | "archive_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/{archive_format}{\/ref}", 79 | "downloads_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/downloads", 80 | "issues_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues{\/number}", 81 | "pulls_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/pulls{\/number}", 82 | "milestones_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/milestones{\/number}", 83 | "notifications_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/notifications{?since,all,participating}", 84 | "labels_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/labels{\/name}", 85 | "releases_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/releases{\/id}", 86 | "deployments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/deployments", 87 | "created_at": 1393946534, 88 | "updated_at": "2016-02-12T20:29:30Z", 89 | "pushed_at": 1455390375, 90 | "git_url": "git:\/\/github.com\/xPaw\/GitHub-WebHook.git", 91 | "ssh_url": "git@github.com:xPaw\/GitHub-WebHook.git", 92 | "clone_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook.git", 93 | "svn_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 94 | "homepage": "", 95 | "size": 67, 96 | "stargazers_count": 11, 97 | "watchers_count": 11, 98 | "language": "PHP", 99 | "has_issues": true, 100 | "has_downloads": true, 101 | "has_wiki": false, 102 | "has_pages": false, 103 | "forks_count": 3, 104 | "mirror_url": null, 105 | "open_issues_count": 3, 106 | "forks": 3, 107 | "open_issues": 3, 108 | "watchers": 11, 109 | "default_branch": "master", 110 | "stargazers": 11, 111 | "master_branch": "master" 112 | }, 113 | "pusher": { 114 | "name": "xPaw", 115 | "email": "xPaw@users.noreply.github.com" 116 | }, 117 | "sender": { 118 | "login": "xPaw", 119 | "id": 613331, 120 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 121 | "gravatar_id": "", 122 | "url": "https:\/\/api.github.com\/users\/xPaw", 123 | "html_url": "https:\/\/github.com\/xPaw", 124 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 125 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 126 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 127 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 128 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 129 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 130 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 131 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 132 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 133 | "type": "User", 134 | "site_admin": false 135 | }, 136 | "ref_name": "hello-world", 137 | "base_ref_name": "master" 138 | } 139 | -------------------------------------------------------------------------------- /tests/events/ping/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "zen": "Anything added dilutes everything else.", 3 | "hook_id": 7292732, 4 | "hook": { 5 | "url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks\/7292732", 6 | "test_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks\/7292732\/test", 7 | "ping_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks\/7292732\/pings", 8 | "id": 7292732, 9 | "name": "web", 10 | "active": true, 11 | "events": [ 12 | "*" 13 | ], 14 | "config": { 15 | "url": "https:\/\/example.com\/", 16 | "content_type": "json", 17 | "insecure_ssl": "0", 18 | "secret": "" 19 | }, 20 | "last_response": { 21 | "code": null, 22 | "status": "unused", 23 | "message": null 24 | }, 25 | "updated_at": "2016-02-13T12:18:02Z", 26 | "created_at": "2016-02-13T12:18:02Z" 27 | }, 28 | "repository": { 29 | "id": 17406648, 30 | "name": "GitHub-WebHook", 31 | "full_name": "xPaw\/GitHub-WebHook", 32 | "owner": { 33 | "login": "xPaw", 34 | "id": 613331, 35 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 36 | "gravatar_id": "", 37 | "url": "https:\/\/api.github.com\/users\/xPaw", 38 | "html_url": "https:\/\/github.com\/xPaw", 39 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 40 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 41 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 42 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 43 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 44 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 45 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 46 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 47 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 48 | "type": "User", 49 | "site_admin": false 50 | }, 51 | "private": false, 52 | "html_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 53 | "description": ":octocat: Validates and processes GitHub's webhooks", 54 | "fork": false, 55 | "url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook", 56 | "forks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/forks", 57 | "keys_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/keys{\/key_id}", 58 | "collaborators_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/collaborators{\/collaborator}", 59 | "teams_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/teams", 60 | "hooks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks", 61 | "issue_events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/events{\/number}", 62 | "events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/events", 63 | "assignees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/assignees{\/user}", 64 | "branches_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/branches{\/branch}", 65 | "tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/tags", 66 | "blobs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/blobs{\/sha}", 67 | "git_tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/tags{\/sha}", 68 | "git_refs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/refs{\/sha}", 69 | "trees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/trees{\/sha}", 70 | "statuses_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/statuses\/{sha}", 71 | "languages_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/languages", 72 | "stargazers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/stargazers", 73 | "contributors_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contributors", 74 | "subscribers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscribers", 75 | "subscription_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscription", 76 | "commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/commits{\/sha}", 77 | "git_commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/commits{\/sha}", 78 | "comments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/comments{\/number}", 79 | "issue_comment_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/comments{\/number}", 80 | "contents_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contents\/{+path}", 81 | "compare_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/compare\/{base}...{head}", 82 | "merges_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/merges", 83 | "archive_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/{archive_format}{\/ref}", 84 | "downloads_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/downloads", 85 | "issues_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues{\/number}", 86 | "pulls_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/pulls{\/number}", 87 | "milestones_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/milestones{\/number}", 88 | "notifications_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/notifications{?since,all,participating}", 89 | "labels_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/labels{\/name}", 90 | "releases_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/releases{\/id}", 91 | "deployments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/deployments", 92 | "created_at": "2014-03-04T15:22:14Z", 93 | "updated_at": "2016-02-12T20:29:30Z", 94 | "pushed_at": "2016-02-13T12:03:51Z", 95 | "git_url": "git:\/\/github.com\/xPaw\/GitHub-WebHook.git", 96 | "ssh_url": "git@github.com:xPaw\/GitHub-WebHook.git", 97 | "clone_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook.git", 98 | "svn_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 99 | "homepage": "", 100 | "size": 51, 101 | "stargazers_count": 11, 102 | "watchers_count": 11, 103 | "language": "PHP", 104 | "has_issues": true, 105 | "has_downloads": true, 106 | "has_wiki": false, 107 | "has_pages": false, 108 | "forks_count": 3, 109 | "mirror_url": null, 110 | "open_issues_count": 3, 111 | "forks": 3, 112 | "open_issues": 3, 113 | "watchers": 11, 114 | "default_branch": "master" 115 | }, 116 | "sender": { 117 | "login": "xPaw", 118 | "id": 613331, 119 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 120 | "gravatar_id": "", 121 | "url": "https:\/\/api.github.com\/users\/xPaw", 122 | "html_url": "https:\/\/github.com\/xPaw", 123 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 124 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 125 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 126 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 127 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 128 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 129 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 130 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 131 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 132 | "type": "User", 133 | "site_admin": false 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /tests/events/member/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "added", 3 | "member": { 4 | "login": "timmw", 5 | "id": 367327, 6 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/367327?v=3", 7 | "gravatar_id": "", 8 | "url": "https:\/\/api.github.com\/users\/timmw", 9 | "html_url": "https:\/\/github.com\/timmw", 10 | "followers_url": "https:\/\/api.github.com\/users\/timmw\/followers", 11 | "following_url": "https:\/\/api.github.com\/users\/timmw\/following{\/other_user}", 12 | "gists_url": "https:\/\/api.github.com\/users\/timmw\/gists{\/gist_id}", 13 | "starred_url": "https:\/\/api.github.com\/users\/timmw\/starred{\/owner}{\/repo}", 14 | "subscriptions_url": "https:\/\/api.github.com\/users\/timmw\/subscriptions", 15 | "organizations_url": "https:\/\/api.github.com\/users\/timmw\/orgs", 16 | "repos_url": "https:\/\/api.github.com\/users\/timmw\/repos", 17 | "events_url": "https:\/\/api.github.com\/users\/timmw\/events{\/privacy}", 18 | "received_events_url": "https:\/\/api.github.com\/users\/timmw\/received_events", 19 | "type": "User", 20 | "site_admin": false 21 | }, 22 | "repository": { 23 | "id": 17406648, 24 | "name": "GitHub-WebHook", 25 | "full_name": "xPaw\/GitHub-WebHook", 26 | "owner": { 27 | "login": "xPaw", 28 | "id": 613331, 29 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 30 | "gravatar_id": "", 31 | "url": "https:\/\/api.github.com\/users\/xPaw", 32 | "html_url": "https:\/\/github.com\/xPaw", 33 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 34 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 35 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 36 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 37 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 38 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 39 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 40 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 41 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 42 | "type": "User", 43 | "site_admin": false 44 | }, 45 | "private": false, 46 | "html_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 47 | "description": ":octocat: Validates and processes GitHub's webhooks", 48 | "fork": false, 49 | "url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook", 50 | "forks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/forks", 51 | "keys_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/keys{\/key_id}", 52 | "collaborators_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/collaborators{\/collaborator}", 53 | "teams_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/teams", 54 | "hooks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks", 55 | "issue_events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/events{\/number}", 56 | "events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/events", 57 | "assignees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/assignees{\/user}", 58 | "branches_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/branches{\/branch}", 59 | "tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/tags", 60 | "blobs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/blobs{\/sha}", 61 | "git_tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/tags{\/sha}", 62 | "git_refs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/refs{\/sha}", 63 | "trees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/trees{\/sha}", 64 | "statuses_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/statuses\/{sha}", 65 | "languages_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/languages", 66 | "stargazers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/stargazers", 67 | "contributors_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contributors", 68 | "subscribers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscribers", 69 | "subscription_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscription", 70 | "commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/commits{\/sha}", 71 | "git_commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/commits{\/sha}", 72 | "comments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/comments{\/number}", 73 | "issue_comment_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/comments{\/number}", 74 | "contents_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contents\/{+path}", 75 | "compare_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/compare\/{base}...{head}", 76 | "merges_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/merges", 77 | "archive_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/{archive_format}{\/ref}", 78 | "downloads_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/downloads", 79 | "issues_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues{\/number}", 80 | "pulls_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/pulls{\/number}", 81 | "milestones_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/milestones{\/number}", 82 | "notifications_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/notifications{?since,all,participating}", 83 | "labels_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/labels{\/name}", 84 | "releases_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/releases{\/id}", 85 | "deployments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/deployments", 86 | "created_at": "2014-03-04T15:22:14Z", 87 | "updated_at": "2016-02-12T20:29:30Z", 88 | "pushed_at": "2016-02-13T19:17:54Z", 89 | "git_url": "git:\/\/github.com\/xPaw\/GitHub-WebHook.git", 90 | "ssh_url": "git@github.com:xPaw\/GitHub-WebHook.git", 91 | "clone_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook.git", 92 | "svn_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 93 | "homepage": "", 94 | "size": 71, 95 | "stargazers_count": 11, 96 | "watchers_count": 11, 97 | "language": "PHP", 98 | "has_issues": true, 99 | "has_downloads": true, 100 | "has_wiki": false, 101 | "has_pages": false, 102 | "forks_count": 3, 103 | "mirror_url": null, 104 | "open_issues_count": 3, 105 | "forks": 3, 106 | "open_issues": 3, 107 | "watchers": 11, 108 | "default_branch": "master" 109 | }, 110 | "sender": { 111 | "login": "xPaw", 112 | "id": 613331, 113 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 114 | "gravatar_id": "", 115 | "url": "https:\/\/api.github.com\/users\/xPaw", 116 | "html_url": "https:\/\/github.com\/xPaw", 117 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 118 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 119 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 120 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 121 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 122 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 123 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 124 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 125 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 126 | "type": "User", 127 | "site_admin": false 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /tests/events/repository/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "created", 3 | "repository": { 4 | "id": 51690828, 5 | "name": "new-repository", 6 | "full_name": "SteamDatabase\/new-repository", 7 | "owner": { 8 | "login": "SteamDatabase", 9 | "id": 3866120, 10 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/3866120?v=3", 11 | "gravatar_id": "", 12 | "url": "https:\/\/api.github.com\/users\/SteamDatabase", 13 | "html_url": "https:\/\/github.com\/SteamDatabase", 14 | "followers_url": "https:\/\/api.github.com\/users\/SteamDatabase\/followers", 15 | "following_url": "https:\/\/api.github.com\/users\/SteamDatabase\/following{\/other_user}", 16 | "gists_url": "https:\/\/api.github.com\/users\/SteamDatabase\/gists{\/gist_id}", 17 | "starred_url": "https:\/\/api.github.com\/users\/SteamDatabase\/starred{\/owner}{\/repo}", 18 | "subscriptions_url": "https:\/\/api.github.com\/users\/SteamDatabase\/subscriptions", 19 | "organizations_url": "https:\/\/api.github.com\/users\/SteamDatabase\/orgs", 20 | "repos_url": "https:\/\/api.github.com\/users\/SteamDatabase\/repos", 21 | "events_url": "https:\/\/api.github.com\/users\/SteamDatabase\/events{\/privacy}", 22 | "received_events_url": "https:\/\/api.github.com\/users\/SteamDatabase\/received_events", 23 | "type": "Organization", 24 | "site_admin": false 25 | }, 26 | "private": false, 27 | "html_url": "https:\/\/github.com\/SteamDatabase\/new-repository", 28 | "description": "", 29 | "fork": false, 30 | "url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository", 31 | "forks_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/forks", 32 | "keys_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/keys{\/key_id}", 33 | "collaborators_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/collaborators{\/collaborator}", 34 | "teams_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/teams", 35 | "hooks_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/hooks", 36 | "issue_events_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/issues\/events{\/number}", 37 | "events_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/events", 38 | "assignees_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/assignees{\/user}", 39 | "branches_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/branches{\/branch}", 40 | "tags_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/tags", 41 | "blobs_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/git\/blobs{\/sha}", 42 | "git_tags_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/git\/tags{\/sha}", 43 | "git_refs_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/git\/refs{\/sha}", 44 | "trees_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/git\/trees{\/sha}", 45 | "statuses_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/statuses\/{sha}", 46 | "languages_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/languages", 47 | "stargazers_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/stargazers", 48 | "contributors_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/contributors", 49 | "subscribers_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/subscribers", 50 | "subscription_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/subscription", 51 | "commits_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/commits{\/sha}", 52 | "git_commits_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/git\/commits{\/sha}", 53 | "comments_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/comments{\/number}", 54 | "issue_comment_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/issues\/comments{\/number}", 55 | "contents_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/contents\/{+path}", 56 | "compare_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/compare\/{base}...{head}", 57 | "merges_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/merges", 58 | "archive_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/{archive_format}{\/ref}", 59 | "downloads_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/downloads", 60 | "issues_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/issues{\/number}", 61 | "pulls_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/pulls{\/number}", 62 | "milestones_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/milestones{\/number}", 63 | "notifications_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/notifications{?since,all,participating}", 64 | "labels_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/labels{\/name}", 65 | "releases_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/releases{\/id}", 66 | "deployments_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/new-repository\/deployments", 67 | "created_at": "2016-02-14T10:47:56Z", 68 | "updated_at": "2016-02-14T10:47:56Z", 69 | "pushed_at": "2016-02-14T10:47:56Z", 70 | "git_url": "git:\/\/github.com\/SteamDatabase\/new-repository.git", 71 | "ssh_url": "git@github.com:SteamDatabase\/new-repository.git", 72 | "clone_url": "https:\/\/github.com\/SteamDatabase\/new-repository.git", 73 | "svn_url": "https:\/\/github.com\/SteamDatabase\/new-repository", 74 | "homepage": null, 75 | "size": 0, 76 | "stargazers_count": 0, 77 | "watchers_count": 0, 78 | "language": null, 79 | "has_issues": true, 80 | "has_downloads": true, 81 | "has_wiki": true, 82 | "has_pages": false, 83 | "forks_count": 0, 84 | "mirror_url": null, 85 | "open_issues_count": 0, 86 | "forks": 0, 87 | "open_issues": 0, 88 | "watchers": 0, 89 | "default_branch": "master" 90 | }, 91 | "organization": { 92 | "login": "SteamDatabase", 93 | "id": 3866120, 94 | "url": "https:\/\/api.github.com\/orgs\/SteamDatabase", 95 | "repos_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/repos", 96 | "events_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/events", 97 | "hooks_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/hooks", 98 | "issues_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/issues", 99 | "members_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/members{\/member}", 100 | "public_members_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/public_members{\/member}", 101 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/3866120?v=3", 102 | "description": "" 103 | }, 104 | "sender": { 105 | "login": "xPaw", 106 | "id": 613331, 107 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 108 | "gravatar_id": "", 109 | "url": "https:\/\/api.github.com\/users\/xPaw", 110 | "html_url": "https:\/\/github.com\/xPaw", 111 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 112 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 113 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 114 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 115 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 116 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 117 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 118 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 119 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 120 | "type": "User", 121 | "site_admin": false 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /tests/events/push/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "refs\/heads\/master", 3 | "before": "14e514deb5f85f4de5e2ed24e85cfa038f36d60e", 4 | "after": "8ddec647cc7a5a819669ad55d08cfabe49925311", 5 | "created": false, 6 | "deleted": false, 7 | "forced": false, 8 | "base_ref": null, 9 | "compare": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/compare\/14e514deb5f8...8ddec647cc7a", 10 | "commits": [ 11 | { 12 | "id": "8ddec647cc7a5a819669ad55d08cfabe49925311", 13 | "distinct": true, 14 | "message": "Add event tests that can be easily expanded to cover more events", 15 | "timestamp": "2016-02-13T14:45:18+02:00", 16 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/8ddec647cc7a5a819669ad55d08cfabe49925311", 17 | "author": { 18 | "name": "Pavel Djundik", 19 | "email": "xPaw@users.noreply.github.com", 20 | "username": "xPaw" 21 | }, 22 | "committer": { 23 | "name": "Pavel Djundik", 24 | "email": "xPaw@users.noreply.github.com", 25 | "username": "xPaw" 26 | }, 27 | "added": [ 28 | "tests\/EventTest.php", 29 | "tests\/events\/ping\/expected.bin", 30 | "tests\/events\/ping\/payload.json", 31 | "tests\/phpunit.xml" 32 | ], 33 | "removed": [], 34 | "modified": [ 35 | "GitHub_WebHook.php" 36 | ] 37 | } 38 | ], 39 | "head_commit": { 40 | "id": "8ddec647cc7a5a819669ad55d08cfabe49925311", 41 | "distinct": true, 42 | "message": "Add event tests that can be easily expanded to cover more events", 43 | "timestamp": "2016-02-13T14:45:18+02:00", 44 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/8ddec647cc7a5a819669ad55d08cfabe49925311", 45 | "author": { 46 | "name": "Pavel Djundik", 47 | "email": "xPaw@users.noreply.github.com", 48 | "username": "xPaw" 49 | }, 50 | "committer": { 51 | "name": "Pavel Djundik", 52 | "email": "xPaw@users.noreply.github.com", 53 | "username": "xPaw" 54 | }, 55 | "added": [ 56 | "tests\/EventTest.php", 57 | "tests\/events\/ping\/expected.bin", 58 | "tests\/events\/ping\/payload.json", 59 | "tests\/phpunit.xml" 60 | ], 61 | "removed": [], 62 | "modified": [ 63 | "GitHub_WebHook.php" 64 | ] 65 | }, 66 | "repository": { 67 | "id": 17406648, 68 | "name": "GitHub-WebHook", 69 | "full_name": "xPaw\/GitHub-WebHook", 70 | "owner": { 71 | "name": "xPaw", 72 | "email": "xPaw@users.noreply.github.com" 73 | }, 74 | "private": false, 75 | "html_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 76 | "description": ":octocat: Validates and processes GitHub's webhooks", 77 | "fork": false, 78 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 79 | "forks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/forks", 80 | "keys_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/keys{\/key_id}", 81 | "collaborators_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/collaborators{\/collaborator}", 82 | "teams_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/teams", 83 | "hooks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks", 84 | "issue_events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/events{\/number}", 85 | "events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/events", 86 | "assignees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/assignees{\/user}", 87 | "branches_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/branches{\/branch}", 88 | "tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/tags", 89 | "blobs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/blobs{\/sha}", 90 | "git_tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/tags{\/sha}", 91 | "git_refs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/refs{\/sha}", 92 | "trees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/trees{\/sha}", 93 | "statuses_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/statuses\/{sha}", 94 | "languages_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/languages", 95 | "stargazers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/stargazers", 96 | "contributors_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contributors", 97 | "subscribers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscribers", 98 | "subscription_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscription", 99 | "commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/commits{\/sha}", 100 | "git_commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/commits{\/sha}", 101 | "comments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/comments{\/number}", 102 | "issue_comment_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/comments{\/number}", 103 | "contents_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contents\/{+path}", 104 | "compare_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/compare\/{base}...{head}", 105 | "merges_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/merges", 106 | "archive_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/{archive_format}{\/ref}", 107 | "downloads_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/downloads", 108 | "issues_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues{\/number}", 109 | "pulls_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/pulls{\/number}", 110 | "milestones_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/milestones{\/number}", 111 | "notifications_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/notifications{?since,all,participating}", 112 | "labels_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/labels{\/name}", 113 | "releases_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/releases{\/id}", 114 | "deployments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/deployments", 115 | "created_at": 1393946534, 116 | "updated_at": "2016-02-12T20:29:30Z", 117 | "pushed_at": 1455367533, 118 | "git_url": "git:\/\/github.com\/xPaw\/GitHub-WebHook.git", 119 | "ssh_url": "git@github.com:xPaw\/GitHub-WebHook.git", 120 | "clone_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook.git", 121 | "svn_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 122 | "homepage": "", 123 | "size": 51, 124 | "stargazers_count": 11, 125 | "watchers_count": 11, 126 | "language": "PHP", 127 | "has_issues": true, 128 | "has_downloads": true, 129 | "has_wiki": false, 130 | "has_pages": false, 131 | "forks_count": 3, 132 | "mirror_url": null, 133 | "open_issues_count": 3, 134 | "forks": 3, 135 | "open_issues": 3, 136 | "watchers": 11, 137 | "default_branch": "master", 138 | "stargazers": 11, 139 | "master_branch": "master" 140 | }, 141 | "pusher": { 142 | "name": "xPaw", 143 | "email": "xPaw@users.noreply.github.com" 144 | }, 145 | "sender": { 146 | "login": "xPaw", 147 | "id": 613331, 148 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 149 | "gravatar_id": "", 150 | "url": "https:\/\/api.github.com\/users\/xPaw", 151 | "html_url": "https:\/\/github.com\/xPaw", 152 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 153 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 154 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 155 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 156 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 157 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 158 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 159 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 160 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 161 | "type": "User", 162 | "site_admin": false 163 | }, 164 | "ref_name": "master" 165 | } 166 | -------------------------------------------------------------------------------- /tests/events/commit_comment/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "created", 3 | "comment": { 4 | "url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/comments\/16082791", 5 | "html_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/daf13dcaf435472847deec105edc97a29c30465d#commitcomment-16082791", 6 | "id": 16082791, 7 | "user": { 8 | "login": "xPaw", 9 | "id": 613331, 10 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 11 | "gravatar_id": "", 12 | "url": "https:\/\/api.github.com\/users\/xPaw", 13 | "html_url": "https:\/\/github.com\/xPaw", 14 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 15 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 16 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 17 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 18 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 19 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 20 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 21 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 22 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 23 | "type": "User", 24 | "site_admin": false 25 | }, 26 | "position": null, 27 | "line": null, 28 | "path": "", 29 | "commit_id": "daf13dcaf435472847deec105edc97a29c30465d", 30 | "created_at": "2016-02-14T10:53:58Z", 31 | "updated_at": "2016-02-14T10:53:58Z", 32 | "body": "test commit comment :heart: " 33 | }, 34 | "repository": { 35 | "id": 17406648, 36 | "name": "GitHub-WebHook", 37 | "full_name": "xPaw\/GitHub-WebHook", 38 | "owner": { 39 | "login": "xPaw", 40 | "id": 613331, 41 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 42 | "gravatar_id": "", 43 | "url": "https:\/\/api.github.com\/users\/xPaw", 44 | "html_url": "https:\/\/github.com\/xPaw", 45 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 46 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 47 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 48 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 49 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 50 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 51 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 52 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 53 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 54 | "type": "User", 55 | "site_admin": false 56 | }, 57 | "private": false, 58 | "html_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 59 | "description": ":octocat: Validates and processes GitHub's webhooks", 60 | "fork": false, 61 | "url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook", 62 | "forks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/forks", 63 | "keys_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/keys{\/key_id}", 64 | "collaborators_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/collaborators{\/collaborator}", 65 | "teams_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/teams", 66 | "hooks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks", 67 | "issue_events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/events{\/number}", 68 | "events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/events", 69 | "assignees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/assignees{\/user}", 70 | "branches_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/branches{\/branch}", 71 | "tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/tags", 72 | "blobs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/blobs{\/sha}", 73 | "git_tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/tags{\/sha}", 74 | "git_refs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/refs{\/sha}", 75 | "trees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/trees{\/sha}", 76 | "statuses_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/statuses\/{sha}", 77 | "languages_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/languages", 78 | "stargazers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/stargazers", 79 | "contributors_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contributors", 80 | "subscribers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscribers", 81 | "subscription_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscription", 82 | "commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/commits{\/sha}", 83 | "git_commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/commits{\/sha}", 84 | "comments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/comments{\/number}", 85 | "issue_comment_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/comments{\/number}", 86 | "contents_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contents\/{+path}", 87 | "compare_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/compare\/{base}...{head}", 88 | "merges_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/merges", 89 | "archive_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/{archive_format}{\/ref}", 90 | "downloads_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/downloads", 91 | "issues_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues{\/number}", 92 | "pulls_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/pulls{\/number}", 93 | "milestones_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/milestones{\/number}", 94 | "notifications_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/notifications{?since,all,participating}", 95 | "labels_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/labels{\/name}", 96 | "releases_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/releases{\/id}", 97 | "deployments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/deployments", 98 | "created_at": "2014-03-04T15:22:14Z", 99 | "updated_at": "2016-02-12T20:29:30Z", 100 | "pushed_at": "2016-02-13T19:17:54Z", 101 | "git_url": "git:\/\/github.com\/xPaw\/GitHub-WebHook.git", 102 | "ssh_url": "git@github.com:xPaw\/GitHub-WebHook.git", 103 | "clone_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook.git", 104 | "svn_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 105 | "homepage": "", 106 | "size": 71, 107 | "stargazers_count": 11, 108 | "watchers_count": 11, 109 | "language": "PHP", 110 | "has_issues": true, 111 | "has_downloads": true, 112 | "has_wiki": false, 113 | "has_pages": false, 114 | "forks_count": 3, 115 | "mirror_url": null, 116 | "open_issues_count": 3, 117 | "forks": 3, 118 | "open_issues": 3, 119 | "watchers": 11, 120 | "default_branch": "master" 121 | }, 122 | "sender": { 123 | "login": "xPaw", 124 | "id": 613331, 125 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 126 | "gravatar_id": "", 127 | "url": "https:\/\/api.github.com\/users\/xPaw", 128 | "html_url": "https:\/\/github.com\/xPaw", 129 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 130 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 131 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 132 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 133 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 134 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 135 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 136 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 137 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 138 | "type": "User", 139 | "site_admin": false 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /tests/events/push_tag/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "refs\/tags\/0.0.4", 3 | "before": "0000000000000000000000000000000000000000", 4 | "after": "291b9dd498f2e61f9e26981aef691166c23a80a4", 5 | "created": true, 6 | "deleted": false, 7 | "forced": true, 8 | "base_ref": "refs\/heads\/master", 9 | "compare": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/compare\/0.0.4", 10 | "commits": [], 11 | "head_commit": { 12 | "id": "291b9dd498f2e61f9e26981aef691166c23a80a4", 13 | "distinct": true, 14 | "message": "Upload appveyor test results", 15 | "timestamp": "2016-02-10T20:14:04+02:00", 16 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/commit\/291b9dd498f2e61f9e26981aef691166c23a80a4", 17 | "author": { 18 | "name": "Pavel Djundik", 19 | "email": "xPaw@users.noreply.github.com", 20 | "username": "xPaw" 21 | }, 22 | "committer": { 23 | "name": "Pavel Djundik", 24 | "email": "xPaw@users.noreply.github.com", 25 | "username": "xPaw" 26 | }, 27 | "added": [], 28 | "removed": [], 29 | "modified": [ 30 | "appveyor.yml" 31 | ] 32 | }, 33 | "repository": { 34 | "id": 42366054, 35 | "name": "ValveResourceFormat", 36 | "full_name": "SteamDatabase\/ValveResourceFormat", 37 | "owner": { 38 | "name": "SteamDatabase", 39 | "email": "freeman@steamdb.info" 40 | }, 41 | "private": false, 42 | "html_url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat", 43 | "description": "Valve's Source 2 resource file format parser and decompiler", 44 | "fork": false, 45 | "url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat", 46 | "forks_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/forks", 47 | "keys_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/keys{\/key_id}", 48 | "collaborators_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/collaborators{\/collaborator}", 49 | "teams_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/teams", 50 | "hooks_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/hooks", 51 | "issue_events_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/issues\/events{\/number}", 52 | "events_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/events", 53 | "assignees_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/assignees{\/user}", 54 | "branches_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/branches{\/branch}", 55 | "tags_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/tags", 56 | "blobs_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/blobs{\/sha}", 57 | "git_tags_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/tags{\/sha}", 58 | "git_refs_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/refs{\/sha}", 59 | "trees_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/trees{\/sha}", 60 | "statuses_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/statuses\/{sha}", 61 | "languages_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/languages", 62 | "stargazers_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/stargazers", 63 | "contributors_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/contributors", 64 | "subscribers_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/subscribers", 65 | "subscription_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/subscription", 66 | "commits_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/commits{\/sha}", 67 | "git_commits_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/commits{\/sha}", 68 | "comments_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/comments{\/number}", 69 | "issue_comment_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/issues\/comments{\/number}", 70 | "contents_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/contents\/{+path}", 71 | "compare_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/compare\/{base}...{head}", 72 | "merges_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/merges", 73 | "archive_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/{archive_format}{\/ref}", 74 | "downloads_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/downloads", 75 | "issues_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/issues{\/number}", 76 | "pulls_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/pulls{\/number}", 77 | "milestones_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/milestones{\/number}", 78 | "notifications_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/notifications{?since,all,participating}", 79 | "labels_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/labels{\/name}", 80 | "releases_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/releases{\/id}", 81 | "deployments_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/deployments", 82 | "created_at": 1442078651, 83 | "updated_at": "2016-02-08T10:48:43Z", 84 | "pushed_at": 1455128726, 85 | "git_url": "git:\/\/github.com\/SteamDatabase\/ValveResourceFormat.git", 86 | "ssh_url": "git@github.com:SteamDatabase\/ValveResourceFormat.git", 87 | "clone_url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat.git", 88 | "svn_url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat", 89 | "homepage": null, 90 | "size": 786, 91 | "stargazers_count": 28, 92 | "watchers_count": 28, 93 | "language": "C#", 94 | "has_issues": true, 95 | "has_downloads": true, 96 | "has_wiki": true, 97 | "has_pages": false, 98 | "forks_count": 5, 99 | "mirror_url": null, 100 | "open_issues_count": 19, 101 | "forks": 5, 102 | "open_issues": 19, 103 | "watchers": 28, 104 | "default_branch": "master", 105 | "stargazers": 28, 106 | "master_branch": "master", 107 | "organization": "SteamDatabase" 108 | }, 109 | "pusher": { 110 | "name": "xPaw", 111 | "email": "xPaw@users.noreply.github.com" 112 | }, 113 | "organization": { 114 | "login": "SteamDatabase", 115 | "id": 3866120, 116 | "url": "https:\/\/api.github.com\/orgs\/SteamDatabase", 117 | "repos_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/repos", 118 | "events_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/events", 119 | "hooks_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/hooks", 120 | "issues_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/issues", 121 | "members_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/members{\/member}", 122 | "public_members_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/public_members{\/member}", 123 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/3866120?v=3", 124 | "description": "" 125 | }, 126 | "sender": { 127 | "login": "xPaw", 128 | "id": 613331, 129 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 130 | "gravatar_id": "", 131 | "url": "https:\/\/api.github.com\/users\/xPaw", 132 | "html_url": "https:\/\/github.com\/xPaw", 133 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 134 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 135 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 136 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 137 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 138 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 139 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 140 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 141 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 142 | "type": "User", 143 | "site_admin": false 144 | }, 145 | "ref_name": "0.0.4", 146 | "base_ref_name": "master" 147 | } 148 | -------------------------------------------------------------------------------- /tests/events/repository_renamed/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "renamed", 3 | "changes": { 4 | "repository": { 5 | "name": { 6 | "from": "steamdb.info" 7 | } 8 | } 9 | }, 10 | "repository": { 11 | "id": 8165636, 12 | "node_id": "MDEwOlJlcG9zaXRvcnk4MTY1NjM2", 13 | "name": "steamdb.info-issues", 14 | "full_name": "SteamDatabase/steamdb.info-issues", 15 | "private": false, 16 | "owner": { 17 | "login": "SteamDatabase", 18 | "id": 3866120, 19 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4NjYxMjA=", 20 | "avatar_url": "https://avatars.githubusercontent.com/u/3866120?v=4", 21 | "gravatar_id": "", 22 | "url": "https://api.github.com/users/SteamDatabase", 23 | "html_url": "https://github.com/SteamDatabase", 24 | "followers_url": "https://api.github.com/users/SteamDatabase/followers", 25 | "following_url": "https://api.github.com/users/SteamDatabase/following{/other_user}", 26 | "gists_url": "https://api.github.com/users/SteamDatabase/gists{/gist_id}", 27 | "starred_url": "https://api.github.com/users/SteamDatabase/starred{/owner}{/repo}", 28 | "subscriptions_url": "https://api.github.com/users/SteamDatabase/subscriptions", 29 | "organizations_url": "https://api.github.com/users/SteamDatabase/orgs", 30 | "repos_url": "https://api.github.com/users/SteamDatabase/repos", 31 | "events_url": "https://api.github.com/users/SteamDatabase/events{/privacy}", 32 | "received_events_url": "https://api.github.com/users/SteamDatabase/received_events", 33 | "type": "Organization", 34 | "site_admin": false 35 | }, 36 | "html_url": "https://github.com/SteamDatabase/steamdb.info-issues", 37 | "description": "🚱 Issue tracker for Steam Database website", 38 | "fork": false, 39 | "url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues", 40 | "forks_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/forks", 41 | "keys_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/keys{/key_id}", 42 | "collaborators_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/collaborators{/collaborator}", 43 | "teams_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/teams", 44 | "hooks_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/hooks", 45 | "issue_events_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/issues/events{/number}", 46 | "events_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/events", 47 | "assignees_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/assignees{/user}", 48 | "branches_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/branches{/branch}", 49 | "tags_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/tags", 50 | "blobs_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/git/blobs{/sha}", 51 | "git_tags_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/git/tags{/sha}", 52 | "git_refs_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/git/refs{/sha}", 53 | "trees_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/git/trees{/sha}", 54 | "statuses_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/statuses/{sha}", 55 | "languages_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/languages", 56 | "stargazers_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/stargazers", 57 | "contributors_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/contributors", 58 | "subscribers_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/subscribers", 59 | "subscription_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/subscription", 60 | "commits_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/commits{/sha}", 61 | "git_commits_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/git/commits{/sha}", 62 | "comments_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/comments{/number}", 63 | "issue_comment_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/issues/comments{/number}", 64 | "contents_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/contents/{+path}", 65 | "compare_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/compare/{base}...{head}", 66 | "merges_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/merges", 67 | "archive_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/{archive_format}{/ref}", 68 | "downloads_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/downloads", 69 | "issues_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/issues{/number}", 70 | "pulls_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/pulls{/number}", 71 | "milestones_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/milestones{/number}", 72 | "notifications_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/notifications{?since,all,participating}", 73 | "labels_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/labels{/name}", 74 | "releases_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/releases{/id}", 75 | "deployments_url": "https://api.github.com/repos/SteamDatabase/steamdb.info-issues/deployments", 76 | "created_at": "2013-02-12T19:33:13Z", 77 | "updated_at": "2021-03-13T09:53:22Z", 78 | "pushed_at": "2021-01-08T19:41:52Z", 79 | "git_url": "git://github.com/SteamDatabase/steamdb.info-issues.git", 80 | "ssh_url": "git@github.com:SteamDatabase/steamdb.info-issues.git", 81 | "clone_url": "https://github.com/SteamDatabase/steamdb.info-issues.git", 82 | "svn_url": "https://github.com/SteamDatabase/steamdb.info-issues", 83 | "homepage": "https://steamdb.info", 84 | "size": 342, 85 | "stargazers_count": 394, 86 | "watchers_count": 394, 87 | "language": null, 88 | "has_issues": true, 89 | "has_projects": false, 90 | "has_downloads": true, 91 | "has_wiki": false, 92 | "has_pages": false, 93 | "forks_count": 57, 94 | "mirror_url": null, 95 | "archived": false, 96 | "disabled": false, 97 | "open_issues_count": 9, 98 | "license": { 99 | "key": "unlicense", 100 | "name": "The Unlicense", 101 | "spdx_id": "Unlicense", 102 | "url": "https://api.github.com/licenses/unlicense", 103 | "node_id": "MDc6TGljZW5zZTE1" 104 | }, 105 | "forks": 57, 106 | "open_issues": 9, 107 | "watchers": 394, 108 | "default_branch": "master" 109 | }, 110 | "organization": { 111 | "login": "SteamDatabase", 112 | "id": 3866120, 113 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4NjYxMjA=", 114 | "url": "https://api.github.com/orgs/SteamDatabase", 115 | "repos_url": "https://api.github.com/orgs/SteamDatabase/repos", 116 | "events_url": "https://api.github.com/orgs/SteamDatabase/events", 117 | "hooks_url": "https://api.github.com/orgs/SteamDatabase/hooks", 118 | "issues_url": "https://api.github.com/orgs/SteamDatabase/issues", 119 | "members_url": "https://api.github.com/orgs/SteamDatabase/members{/member}", 120 | "public_members_url": "https://api.github.com/orgs/SteamDatabase/public_members{/member}", 121 | "avatar_url": "https://avatars.githubusercontent.com/u/3866120?v=4", 122 | "description": "🚰 We occasionally make the pipes leak" 123 | }, 124 | "sender": { 125 | "login": "xPaw", 126 | "id": 613331, 127 | "node_id": "MDQ6VXNlcjYxMzMzMQ==", 128 | "avatar_url": "https://avatars.githubusercontent.com/u/613331?v=4", 129 | "gravatar_id": "", 130 | "url": "https://api.github.com/users/xPaw", 131 | "html_url": "https://github.com/xPaw", 132 | "followers_url": "https://api.github.com/users/xPaw/followers", 133 | "following_url": "https://api.github.com/users/xPaw/following{/other_user}", 134 | "gists_url": "https://api.github.com/users/xPaw/gists{/gist_id}", 135 | "starred_url": "https://api.github.com/users/xPaw/starred{/owner}{/repo}", 136 | "subscriptions_url": "https://api.github.com/users/xPaw/subscriptions", 137 | "organizations_url": "https://api.github.com/users/xPaw/orgs", 138 | "repos_url": "https://api.github.com/users/xPaw/repos", 139 | "events_url": "https://api.github.com/users/xPaw/events{/privacy}", 140 | "received_events_url": "https://api.github.com/users/xPaw/received_events", 141 | "type": "User", 142 | "site_admin": false 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /tests/events/gollum/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | { 4 | "page_name": "_Sidebar", 5 | "title": "_Sidebar", 6 | "summary": null, 7 | "action": "edited", 8 | "sha": "94b8720e6a96a73ddbb639b06e5b29b98eb81a36", 9 | "html_url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat\/wiki\/_Sidebar" 10 | } 11 | ], 12 | "repository": { 13 | "id": 42366054, 14 | "name": "ValveResourceFormat", 15 | "full_name": "SteamDatabase\/ValveResourceFormat", 16 | "owner": { 17 | "login": "SteamDatabase", 18 | "id": 3866120, 19 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/3866120?v=3", 20 | "gravatar_id": "", 21 | "url": "https:\/\/api.github.com\/users\/SteamDatabase", 22 | "html_url": "https:\/\/github.com\/SteamDatabase", 23 | "followers_url": "https:\/\/api.github.com\/users\/SteamDatabase\/followers", 24 | "following_url": "https:\/\/api.github.com\/users\/SteamDatabase\/following{\/other_user}", 25 | "gists_url": "https:\/\/api.github.com\/users\/SteamDatabase\/gists{\/gist_id}", 26 | "starred_url": "https:\/\/api.github.com\/users\/SteamDatabase\/starred{\/owner}{\/repo}", 27 | "subscriptions_url": "https:\/\/api.github.com\/users\/SteamDatabase\/subscriptions", 28 | "organizations_url": "https:\/\/api.github.com\/users\/SteamDatabase\/orgs", 29 | "repos_url": "https:\/\/api.github.com\/users\/SteamDatabase\/repos", 30 | "events_url": "https:\/\/api.github.com\/users\/SteamDatabase\/events{\/privacy}", 31 | "received_events_url": "https:\/\/api.github.com\/users\/SteamDatabase\/received_events", 32 | "type": "Organization", 33 | "site_admin": false 34 | }, 35 | "private": false, 36 | "html_url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat", 37 | "description": "Valve's Source 2 resource file format parser and decompiler", 38 | "fork": false, 39 | "url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat", 40 | "forks_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/forks", 41 | "keys_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/keys{\/key_id}", 42 | "collaborators_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/collaborators{\/collaborator}", 43 | "teams_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/teams", 44 | "hooks_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/hooks", 45 | "issue_events_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/issues\/events{\/number}", 46 | "events_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/events", 47 | "assignees_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/assignees{\/user}", 48 | "branches_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/branches{\/branch}", 49 | "tags_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/tags", 50 | "blobs_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/blobs{\/sha}", 51 | "git_tags_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/tags{\/sha}", 52 | "git_refs_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/refs{\/sha}", 53 | "trees_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/trees{\/sha}", 54 | "statuses_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/statuses\/{sha}", 55 | "languages_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/languages", 56 | "stargazers_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/stargazers", 57 | "contributors_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/contributors", 58 | "subscribers_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/subscribers", 59 | "subscription_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/subscription", 60 | "commits_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/commits{\/sha}", 61 | "git_commits_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/git\/commits{\/sha}", 62 | "comments_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/comments{\/number}", 63 | "issue_comment_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/issues\/comments{\/number}", 64 | "contents_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/contents\/{+path}", 65 | "compare_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/compare\/{base}...{head}", 66 | "merges_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/merges", 67 | "archive_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/{archive_format}{\/ref}", 68 | "downloads_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/downloads", 69 | "issues_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/issues{\/number}", 70 | "pulls_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/pulls{\/number}", 71 | "milestones_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/milestones{\/number}", 72 | "notifications_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/notifications{?since,all,participating}", 73 | "labels_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/labels{\/name}", 74 | "releases_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/releases{\/id}", 75 | "deployments_url": "https:\/\/api.github.com\/repos\/SteamDatabase\/ValveResourceFormat\/deployments", 76 | "created_at": "2015-09-12T17:24:11Z", 77 | "updated_at": "2016-02-08T10:48:43Z", 78 | "pushed_at": "2016-02-12T14:17:07Z", 79 | "git_url": "git:\/\/github.com\/SteamDatabase\/ValveResourceFormat.git", 80 | "ssh_url": "git@github.com:SteamDatabase\/ValveResourceFormat.git", 81 | "clone_url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat.git", 82 | "svn_url": "https:\/\/github.com\/SteamDatabase\/ValveResourceFormat", 83 | "homepage": null, 84 | "size": 795, 85 | "stargazers_count": 28, 86 | "watchers_count": 28, 87 | "language": "C#", 88 | "has_issues": true, 89 | "has_downloads": true, 90 | "has_wiki": true, 91 | "has_pages": false, 92 | "forks_count": 5, 93 | "mirror_url": null, 94 | "open_issues_count": 20, 95 | "forks": 5, 96 | "open_issues": 20, 97 | "watchers": 28, 98 | "default_branch": "master" 99 | }, 100 | "organization": { 101 | "login": "SteamDatabase", 102 | "id": 3866120, 103 | "url": "https:\/\/api.github.com\/orgs\/SteamDatabase", 104 | "repos_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/repos", 105 | "events_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/events", 106 | "hooks_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/hooks", 107 | "issues_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/issues", 108 | "members_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/members{\/member}", 109 | "public_members_url": "https:\/\/api.github.com\/orgs\/SteamDatabase\/public_members{\/member}", 110 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/3866120?v=3", 111 | "description": "" 112 | }, 113 | "sender": { 114 | "login": "xPaw", 115 | "id": 613331, 116 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 117 | "gravatar_id": "", 118 | "url": "https:\/\/api.github.com\/users\/xPaw", 119 | "html_url": "https:\/\/github.com\/xPaw", 120 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 121 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 122 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 123 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 124 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 125 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 126 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 127 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 128 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 129 | "type": "User", 130 | "site_admin": false 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /tests/events/project/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "created", 3 | "project": { 4 | "owner_url": "https://api.github.com/repos/Codertocat/Hello-World", 5 | "url": "https://api.github.com/projects/2640902", 6 | "html_url": "https://github.com/Codertocat/Hello-World/projects/1", 7 | "columns_url": "https://api.github.com/projects/2640902/columns", 8 | "id": 2640902, 9 | "node_id": "MDc6UHJvamVjdDI2NDA5MDI=", 10 | "name": "Space 2.0", 11 | "body": "Project tasks for a trip to Space", 12 | "number": 1, 13 | "state": "open", 14 | "creator": { 15 | "login": "Codertocat", 16 | "id": 21031067, 17 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 18 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 19 | "gravatar_id": "", 20 | "url": "https://api.github.com/users/Codertocat", 21 | "html_url": "https://github.com/Codertocat", 22 | "followers_url": "https://api.github.com/users/Codertocat/followers", 23 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 24 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 25 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 26 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 27 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 28 | "repos_url": "https://api.github.com/users/Codertocat/repos", 29 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 30 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 31 | "type": "User", 32 | "site_admin": false 33 | }, 34 | "created_at": "2019-05-15T15:21:06Z", 35 | "updated_at": "2019-05-15T15:21:06Z" 36 | }, 37 | "repository": { 38 | "id": 186853002, 39 | "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", 40 | "name": "Hello-World", 41 | "full_name": "Codertocat/Hello-World", 42 | "private": false, 43 | "owner": { 44 | "login": "Codertocat", 45 | "id": 21031067, 46 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 47 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 48 | "gravatar_id": "", 49 | "url": "https://api.github.com/users/Codertocat", 50 | "html_url": "https://github.com/Codertocat", 51 | "followers_url": "https://api.github.com/users/Codertocat/followers", 52 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 53 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 54 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 55 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 56 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 57 | "repos_url": "https://api.github.com/users/Codertocat/repos", 58 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 59 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 60 | "type": "User", 61 | "site_admin": false 62 | }, 63 | "html_url": "https://github.com/Codertocat/Hello-World", 64 | "description": null, 65 | "fork": false, 66 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 67 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 68 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 69 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 70 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 71 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 72 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 73 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 74 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 75 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 76 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 77 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 78 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 79 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 80 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 81 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 82 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 83 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 84 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 85 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 86 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 87 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 88 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 89 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 90 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 91 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 92 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 93 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 94 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 95 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 96 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 97 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 98 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 99 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 100 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 101 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 102 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 103 | "created_at": "2019-05-15T15:19:25Z", 104 | "updated_at": "2019-05-15T15:21:03Z", 105 | "pushed_at": "2019-05-15T15:20:57Z", 106 | "git_url": "git://github.com/Codertocat/Hello-World.git", 107 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 108 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 109 | "svn_url": "https://github.com/Codertocat/Hello-World", 110 | "homepage": null, 111 | "size": 0, 112 | "stargazers_count": 0, 113 | "watchers_count": 0, 114 | "language": "Ruby", 115 | "has_issues": true, 116 | "has_projects": true, 117 | "has_downloads": true, 118 | "has_wiki": true, 119 | "has_pages": true, 120 | "forks_count": 1, 121 | "mirror_url": null, 122 | "archived": false, 123 | "disabled": false, 124 | "open_issues_count": 2, 125 | "license": null, 126 | "forks": 1, 127 | "open_issues": 2, 128 | "watchers": 0, 129 | "default_branch": "master" 130 | }, 131 | "sender": { 132 | "login": "Codertocat", 133 | "id": 21031067, 134 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 135 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 136 | "gravatar_id": "", 137 | "url": "https://api.github.com/users/Codertocat", 138 | "html_url": "https://github.com/Codertocat", 139 | "followers_url": "https://api.github.com/users/Codertocat/followers", 140 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 141 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 142 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 143 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 144 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 145 | "repos_url": "https://api.github.com/users/Codertocat/repos", 146 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 147 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 148 | "type": "User", 149 | "site_admin": false 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /tests/events/milestone/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "created", 3 | "milestone": { 4 | "url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1", 5 | "html_url": "https://github.com/Codertocat/Hello-World/milestone/1", 6 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones/1/labels", 7 | "id": 4317517, 8 | "node_id": "MDk6TWlsZXN0b25lNDMxNzUxNw==", 9 | "number": 1, 10 | "title": "v1.0", 11 | "description": "Add new space flight simulator", 12 | "creator": { 13 | "login": "Codertocat", 14 | "id": 21031067, 15 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 16 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 17 | "gravatar_id": "", 18 | "url": "https://api.github.com/users/Codertocat", 19 | "html_url": "https://github.com/Codertocat", 20 | "followers_url": "https://api.github.com/users/Codertocat/followers", 21 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 22 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 23 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 24 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 25 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 26 | "repos_url": "https://api.github.com/users/Codertocat/repos", 27 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 28 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 29 | "type": "User", 30 | "site_admin": false 31 | }, 32 | "open_issues": 0, 33 | "closed_issues": 0, 34 | "state": "open", 35 | "created_at": "2019-05-15T15:20:17Z", 36 | "updated_at": "2019-05-15T15:20:17Z", 37 | "due_on": "2019-05-23T07:00:00Z", 38 | "closed_at": null 39 | }, 40 | "repository": { 41 | "id": 186853002, 42 | "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=", 43 | "name": "Hello-World", 44 | "full_name": "Codertocat/Hello-World", 45 | "private": false, 46 | "owner": { 47 | "login": "Codertocat", 48 | "id": 21031067, 49 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 50 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 51 | "gravatar_id": "", 52 | "url": "https://api.github.com/users/Codertocat", 53 | "html_url": "https://github.com/Codertocat", 54 | "followers_url": "https://api.github.com/users/Codertocat/followers", 55 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 56 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 57 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 58 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 59 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 60 | "repos_url": "https://api.github.com/users/Codertocat/repos", 61 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 62 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 63 | "type": "User", 64 | "site_admin": false 65 | }, 66 | "html_url": "https://github.com/Codertocat/Hello-World", 67 | "description": null, 68 | "fork": false, 69 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 70 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 71 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 72 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 73 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 74 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 75 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 76 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 77 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 78 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 79 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 80 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 81 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 82 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 83 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 84 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 85 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 86 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 87 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 88 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 89 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 90 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 91 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 92 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 93 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 94 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 95 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 96 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 97 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 98 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 99 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 100 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 101 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 102 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 103 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 104 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 105 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 106 | "created_at": "2019-05-15T15:19:25Z", 107 | "updated_at": "2019-05-15T15:19:27Z", 108 | "pushed_at": "2019-05-15T15:20:13Z", 109 | "git_url": "git://github.com/Codertocat/Hello-World.git", 110 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 111 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 112 | "svn_url": "https://github.com/Codertocat/Hello-World", 113 | "homepage": null, 114 | "size": 0, 115 | "stargazers_count": 0, 116 | "watchers_count": 0, 117 | "language": null, 118 | "has_issues": true, 119 | "has_projects": true, 120 | "has_downloads": true, 121 | "has_wiki": true, 122 | "has_pages": true, 123 | "forks_count": 0, 124 | "mirror_url": null, 125 | "archived": false, 126 | "disabled": false, 127 | "open_issues_count": 0, 128 | "license": null, 129 | "forks": 0, 130 | "open_issues": 0, 131 | "watchers": 0, 132 | "default_branch": "master" 133 | }, 134 | "sender": { 135 | "login": "Codertocat", 136 | "id": 21031067, 137 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 138 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 139 | "gravatar_id": "", 140 | "url": "https://api.github.com/users/Codertocat", 141 | "html_url": "https://github.com/Codertocat", 142 | "followers_url": "https://api.github.com/users/Codertocat/followers", 143 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 144 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 145 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 146 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 147 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 148 | "repos_url": "https://api.github.com/users/Codertocat/repos", 149 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 150 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 151 | "type": "User", 152 | "site_admin": false 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /tests/events/push_created_plus/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "refs\/heads\/ignored-event-message", 3 | "before": "0000000000000000000000000000000000000000", 4 | "after": "ddb694550ebbb7988193f534063456876acf9cb5", 5 | "created": true, 6 | "deleted": false, 7 | "forced": true, 8 | "base_ref": null, 9 | "compare": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/compare\/181fcf4d9ddf^...ddb694550ebb", 10 | "commits": [ 11 | { 12 | "id": "181fcf4d9ddf6d0d50a04d64b0c0d24393c810bf", 13 | "distinct": true, 14 | "message": "Add exception message in GitHubIgnoredEventException", 15 | "timestamp": "2016-02-14T13:00:53+02:00", 16 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/181fcf4d9ddf6d0d50a04d64b0c0d24393c810bf", 17 | "author": { 18 | "name": "Pavel Djundik", 19 | "email": "xPaw@users.noreply.github.com", 20 | "username": "xPaw" 21 | }, 22 | "committer": { 23 | "name": "Pavel Djundik", 24 | "email": "xPaw@users.noreply.github.com", 25 | "username": "xPaw" 26 | }, 27 | "added": [], 28 | "removed": [], 29 | "modified": [ 30 | "GitHub_IRC.php" 31 | ] 32 | }, 33 | { 34 | "id": "ddb694550ebbb7988193f534063456876acf9cb5", 35 | "distinct": true, 36 | "message": "Fix event comments and get pull request number without regex", 37 | "timestamp": "2016-02-14T13:06:15+02:00", 38 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/ddb694550ebbb7988193f534063456876acf9cb5", 39 | "author": { 40 | "name": "Pavel Djundik", 41 | "email": "xPaw@users.noreply.github.com", 42 | "username": "xPaw" 43 | }, 44 | "committer": { 45 | "name": "Pavel Djundik", 46 | "email": "xPaw@users.noreply.github.com", 47 | "username": "xPaw" 48 | }, 49 | "added": [], 50 | "removed": [], 51 | "modified": [ 52 | "GitHub_IRC.php", 53 | "tests\/events\/pull_request_review_comment\/expected.bin" 54 | ] 55 | } 56 | ], 57 | "head_commit": { 58 | "id": "ddb694550ebbb7988193f534063456876acf9cb5", 59 | "distinct": true, 60 | "message": "Fix event comments and get pull request number without regex", 61 | "timestamp": "2016-02-14T13:06:15+02:00", 62 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook\/commit\/ddb694550ebbb7988193f534063456876acf9cb5", 63 | "author": { 64 | "name": "Pavel Djundik", 65 | "email": "xPaw@users.noreply.github.com", 66 | "username": "xPaw" 67 | }, 68 | "committer": { 69 | "name": "Pavel Djundik", 70 | "email": "xPaw@users.noreply.github.com", 71 | "username": "xPaw" 72 | }, 73 | "added": [], 74 | "removed": [], 75 | "modified": [ 76 | "GitHub_IRC.php", 77 | "tests\/events\/pull_request_review_comment\/expected.bin" 78 | ] 79 | }, 80 | "repository": { 81 | "id": 17406648, 82 | "name": "GitHub-WebHook", 83 | "full_name": "xPaw\/GitHub-WebHook", 84 | "owner": { 85 | "name": "xPaw", 86 | "email": "xPaw@users.noreply.github.com" 87 | }, 88 | "private": false, 89 | "html_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 90 | "description": ":octocat: Validates and processes GitHub's webhooks", 91 | "fork": false, 92 | "url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 93 | "forks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/forks", 94 | "keys_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/keys{\/key_id}", 95 | "collaborators_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/collaborators{\/collaborator}", 96 | "teams_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/teams", 97 | "hooks_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/hooks", 98 | "issue_events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/events{\/number}", 99 | "events_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/events", 100 | "assignees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/assignees{\/user}", 101 | "branches_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/branches{\/branch}", 102 | "tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/tags", 103 | "blobs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/blobs{\/sha}", 104 | "git_tags_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/tags{\/sha}", 105 | "git_refs_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/refs{\/sha}", 106 | "trees_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/trees{\/sha}", 107 | "statuses_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/statuses\/{sha}", 108 | "languages_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/languages", 109 | "stargazers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/stargazers", 110 | "contributors_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contributors", 111 | "subscribers_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscribers", 112 | "subscription_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/subscription", 113 | "commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/commits{\/sha}", 114 | "git_commits_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/git\/commits{\/sha}", 115 | "comments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/comments{\/number}", 116 | "issue_comment_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues\/comments{\/number}", 117 | "contents_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/contents\/{+path}", 118 | "compare_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/compare\/{base}...{head}", 119 | "merges_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/merges", 120 | "archive_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/{archive_format}{\/ref}", 121 | "downloads_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/downloads", 122 | "issues_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/issues{\/number}", 123 | "pulls_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/pulls{\/number}", 124 | "milestones_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/milestones{\/number}", 125 | "notifications_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/notifications{?since,all,participating}", 126 | "labels_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/labels{\/name}", 127 | "releases_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/releases{\/id}", 128 | "deployments_url": "https:\/\/api.github.com\/repos\/xPaw\/GitHub-WebHook\/deployments", 129 | "created_at": 1393946534, 130 | "updated_at": "2016-02-12T20:29:30Z", 131 | "pushed_at": 1455448001, 132 | "git_url": "git:\/\/github.com\/xPaw\/GitHub-WebHook.git", 133 | "ssh_url": "git@github.com:xPaw\/GitHub-WebHook.git", 134 | "clone_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook.git", 135 | "svn_url": "https:\/\/github.com\/xPaw\/GitHub-WebHook", 136 | "homepage": "", 137 | "size": 78, 138 | "stargazers_count": 11, 139 | "watchers_count": 11, 140 | "language": "PHP", 141 | "has_issues": true, 142 | "has_downloads": true, 143 | "has_wiki": false, 144 | "has_pages": false, 145 | "forks_count": 3, 146 | "mirror_url": null, 147 | "open_issues_count": 3, 148 | "forks": 3, 149 | "open_issues": 3, 150 | "watchers": 11, 151 | "default_branch": "master", 152 | "stargazers": 11, 153 | "master_branch": "master" 154 | }, 155 | "pusher": { 156 | "name": "xPaw", 157 | "email": "xPaw@users.noreply.github.com" 158 | }, 159 | "sender": { 160 | "login": "xPaw", 161 | "id": 613331, 162 | "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/613331?v=3", 163 | "gravatar_id": "", 164 | "url": "https:\/\/api.github.com\/users\/xPaw", 165 | "html_url": "https:\/\/github.com\/xPaw", 166 | "followers_url": "https:\/\/api.github.com\/users\/xPaw\/followers", 167 | "following_url": "https:\/\/api.github.com\/users\/xPaw\/following{\/other_user}", 168 | "gists_url": "https:\/\/api.github.com\/users\/xPaw\/gists{\/gist_id}", 169 | "starred_url": "https:\/\/api.github.com\/users\/xPaw\/starred{\/owner}{\/repo}", 170 | "subscriptions_url": "https:\/\/api.github.com\/users\/xPaw\/subscriptions", 171 | "organizations_url": "https:\/\/api.github.com\/users\/xPaw\/orgs", 172 | "repos_url": "https:\/\/api.github.com\/users\/xPaw\/repos", 173 | "events_url": "https:\/\/api.github.com\/users\/xPaw\/events{\/privacy}", 174 | "received_events_url": "https:\/\/api.github.com\/users\/xPaw\/received_events", 175 | "type": "User", 176 | "site_admin": false 177 | }, 178 | "ref_name": "ignored-event-message" 179 | } 180 | -------------------------------------------------------------------------------- /tests/events/repository_transferred/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "transferred", 3 | "changes": { 4 | "owner": { 5 | "from": { 6 | "user": { 7 | "login": "xPaw", 8 | "id": 613331, 9 | "node_id": "MDQ6VXNlcjYxMzMzMQ==", 10 | "avatar_url": "https://avatars.githubusercontent.com/u/613331?v=4", 11 | "gravatar_id": "", 12 | "url": "https://api.github.com/users/xPaw", 13 | "html_url": "https://github.com/xPaw", 14 | "followers_url": "https://api.github.com/users/xPaw/followers", 15 | "following_url": "https://api.github.com/users/xPaw/following{/other_user}", 16 | "gists_url": "https://api.github.com/users/xPaw/gists{/gist_id}", 17 | "starred_url": "https://api.github.com/users/xPaw/starred{/owner}{/repo}", 18 | "subscriptions_url": "https://api.github.com/users/xPaw/subscriptions", 19 | "organizations_url": "https://api.github.com/users/xPaw/orgs", 20 | "repos_url": "https://api.github.com/users/xPaw/repos", 21 | "events_url": "https://api.github.com/users/xPaw/events{/privacy}", 22 | "received_events_url": "https://api.github.com/users/xPaw/received_events", 23 | "type": "User", 24 | "site_admin": false 25 | } 26 | } 27 | } 28 | }, 29 | "repository": { 30 | "id": 297643091, 31 | "node_id": "MDEwOlJlcG9zaXRvcnkyOTc2NDMwOTE=", 32 | "name": "SteamDocsScraper", 33 | "full_name": "SteamDatabase/SteamDocsScraper", 34 | "private": true, 35 | "owner": { 36 | "login": "SteamDatabase", 37 | "id": 3866120, 38 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4NjYxMjA=", 39 | "avatar_url": "https://avatars.githubusercontent.com/u/3866120?v=4", 40 | "gravatar_id": "", 41 | "url": "https://api.github.com/users/SteamDatabase", 42 | "html_url": "https://github.com/SteamDatabase", 43 | "followers_url": "https://api.github.com/users/SteamDatabase/followers", 44 | "following_url": "https://api.github.com/users/SteamDatabase/following{/other_user}", 45 | "gists_url": "https://api.github.com/users/SteamDatabase/gists{/gist_id}", 46 | "starred_url": "https://api.github.com/users/SteamDatabase/starred{/owner}{/repo}", 47 | "subscriptions_url": "https://api.github.com/users/SteamDatabase/subscriptions", 48 | "organizations_url": "https://api.github.com/users/SteamDatabase/orgs", 49 | "repos_url": "https://api.github.com/users/SteamDatabase/repos", 50 | "events_url": "https://api.github.com/users/SteamDatabase/events{/privacy}", 51 | "received_events_url": "https://api.github.com/users/SteamDatabase/received_events", 52 | "type": "Organization", 53 | "site_admin": false 54 | }, 55 | "html_url": "https://github.com/SteamDatabase/SteamDocsScraper", 56 | "description": "Scraper for Steamworks documentation", 57 | "fork": false, 58 | "url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper", 59 | "forks_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/forks", 60 | "keys_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/keys{/key_id}", 61 | "collaborators_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/collaborators{/collaborator}", 62 | "teams_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/teams", 63 | "hooks_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/hooks", 64 | "issue_events_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/issues/events{/number}", 65 | "events_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/events", 66 | "assignees_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/assignees{/user}", 67 | "branches_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/branches{/branch}", 68 | "tags_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/tags", 69 | "blobs_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/git/blobs{/sha}", 70 | "git_tags_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/git/tags{/sha}", 71 | "git_refs_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/git/refs{/sha}", 72 | "trees_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/git/trees{/sha}", 73 | "statuses_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/statuses/{sha}", 74 | "languages_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/languages", 75 | "stargazers_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/stargazers", 76 | "contributors_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/contributors", 77 | "subscribers_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/subscribers", 78 | "subscription_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/subscription", 79 | "commits_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/commits{/sha}", 80 | "git_commits_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/git/commits{/sha}", 81 | "comments_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/comments{/number}", 82 | "issue_comment_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/issues/comments{/number}", 83 | "contents_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/contents/{+path}", 84 | "compare_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/compare/{base}...{head}", 85 | "merges_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/merges", 86 | "archive_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/{archive_format}{/ref}", 87 | "downloads_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/downloads", 88 | "issues_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/issues{/number}", 89 | "pulls_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/pulls{/number}", 90 | "milestones_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/milestones{/number}", 91 | "notifications_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/notifications{?since,all,participating}", 92 | "labels_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/labels{/name}", 93 | "releases_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/releases{/id}", 94 | "deployments_url": "https://api.github.com/repos/SteamDatabase/SteamDocsScraper/deployments", 95 | "created_at": "2020-09-22T12:33:45Z", 96 | "updated_at": "2021-03-18T18:38:33Z", 97 | "pushed_at": "2021-03-16T05:05:52Z", 98 | "git_url": "git://github.com/SteamDatabase/SteamDocsScraper.git", 99 | "ssh_url": "git@github.com:SteamDatabase/SteamDocsScraper.git", 100 | "clone_url": "https://github.com/SteamDatabase/SteamDocsScraper.git", 101 | "svn_url": "https://github.com/SteamDatabase/SteamDocsScraper", 102 | "homepage": "https://partner.steamgames.com/doc/home", 103 | "size": 2177, 104 | "stargazers_count": 0, 105 | "watchers_count": 0, 106 | "language": "PHP", 107 | "has_issues": false, 108 | "has_projects": false, 109 | "has_downloads": true, 110 | "has_wiki": false, 111 | "has_pages": false, 112 | "forks_count": 0, 113 | "mirror_url": null, 114 | "archived": false, 115 | "disabled": false, 116 | "open_issues_count": 0, 117 | "license": { 118 | "key": "other", 119 | "name": "Other", 120 | "spdx_id": "NOASSERTION", 121 | "url": null, 122 | "node_id": "MDc6TGljZW5zZTA=" 123 | }, 124 | "forks": 0, 125 | "open_issues": 0, 126 | "watchers": 0, 127 | "default_branch": "master" 128 | }, 129 | "organization": { 130 | "login": "SteamDatabase", 131 | "id": 3866120, 132 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4NjYxMjA=", 133 | "url": "https://api.github.com/orgs/SteamDatabase", 134 | "repos_url": "https://api.github.com/orgs/SteamDatabase/repos", 135 | "events_url": "https://api.github.com/orgs/SteamDatabase/events", 136 | "hooks_url": "https://api.github.com/orgs/SteamDatabase/hooks", 137 | "issues_url": "https://api.github.com/orgs/SteamDatabase/issues", 138 | "members_url": "https://api.github.com/orgs/SteamDatabase/members{/member}", 139 | "public_members_url": "https://api.github.com/orgs/SteamDatabase/public_members{/member}", 140 | "avatar_url": "https://avatars.githubusercontent.com/u/3866120?v=4", 141 | "description": "🚰 We occasionally make the pipes leak" 142 | }, 143 | "sender": { 144 | "login": "xPaw", 145 | "id": 613331, 146 | "node_id": "MDQ6VXNlcjYxMzMzMQ==", 147 | "avatar_url": "https://avatars.githubusercontent.com/u/613331?v=4", 148 | "gravatar_id": "", 149 | "url": "https://api.github.com/users/xPaw", 150 | "html_url": "https://github.com/xPaw", 151 | "followers_url": "https://api.github.com/users/xPaw/followers", 152 | "following_url": "https://api.github.com/users/xPaw/following{/other_user}", 153 | "gists_url": "https://api.github.com/users/xPaw/gists{/gist_id}", 154 | "starred_url": "https://api.github.com/users/xPaw/starred{/owner}{/repo}", 155 | "subscriptions_url": "https://api.github.com/users/xPaw/subscriptions", 156 | "organizations_url": "https://api.github.com/users/xPaw/orgs", 157 | "repos_url": "https://api.github.com/users/xPaw/repos", 158 | "events_url": "https://api.github.com/users/xPaw/events{/privacy}", 159 | "received_events_url": "https://api.github.com/users/xPaw/received_events", 160 | "type": "User", 161 | "site_admin": false 162 | } 163 | } 164 | --------------------------------------------------------------------------------