├── .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] 12Codertocat 04deleted tag 06simple-tag
2 |
--------------------------------------------------------------------------------
/tests/events/member/expected.bin:
--------------------------------------------------------------------------------
1 | [10GitHub-WebHook] 12xPaw 09added 12timmw as a collaborator
2 |
--------------------------------------------------------------------------------
/tests/events/ping_org/expected.bin:
--------------------------------------------------------------------------------
1 | [10org: SteamDatabase] Hook 14123 worked! Zen: 12Design for failure.
2 |
--------------------------------------------------------------------------------
/tests/events/ping/expected.bin:
--------------------------------------------------------------------------------
1 | [10GitHub-WebHook] Hook 147292732 worked! Zen: 12Anything added dilutes everything else.
2 |
--------------------------------------------------------------------------------
/tests/events/repository/expected.bin:
--------------------------------------------------------------------------------
1 | [10new-repository] 12xPaw 07created this repository. 02https://github.com/SteamDatabase/new-repository
2 |
--------------------------------------------------------------------------------
/tests/events/issue_closed/expected.bin:
--------------------------------------------------------------------------------
1 | [10GitHub-WebHook] 12xPaw 13closed issue 12#5: Add tests. 02https://github.com/xPaw/GitHub-WebHook/issues/5
2 |
--------------------------------------------------------------------------------
/tests/events/project/expected.bin:
--------------------------------------------------------------------------------
1 | [10Hello-World] 12Codertocat 07created project: Space 2.0. 02https://github.com/Codertocat/Hello-World/projects/1
2 |
--------------------------------------------------------------------------------
/tests/events/milestone/expected.bin:
--------------------------------------------------------------------------------
1 | [10Hello-World] 12Codertocat 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] 12xPaw 09renamed this repository. 02https://github.com/SteamDatabase/steamdb.info-issues
2 |
--------------------------------------------------------------------------------
/tests/events/repository_transferred/expected.bin:
--------------------------------------------------------------------------------
1 | [10SteamDocsScraper] 12xPaw 09transferred this repository. 02https://github.com/SteamDatabase/SteamDocsScraper
2 |
--------------------------------------------------------------------------------
/tests/events/issue_closed_not_planned/expected.bin:
--------------------------------------------------------------------------------
1 | [10GitHub-WebHook] 12xPaw 13closed issue 12#5: Add tests. 02https://github.com/xPaw/GitHub-WebHook/issues/5
2 |
--------------------------------------------------------------------------------
/tests/events/issue_comment_delete/expected.bin:
--------------------------------------------------------------------------------
1 | [10ValveResourceFormat] 12xPaw deleted comment in 12#502 14(Optimize texture and animation loading) from 12xPaw
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 12rack: 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 12xPaw!)
2 |
--------------------------------------------------------------------------------
/tests/events/release/expected.bin:
--------------------------------------------------------------------------------
1 | [10ValveResourceFormat] 12xPaw 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] 12Codertocat 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] 12Codertocat 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] 12xPaw 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 12rack: 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 12rack: 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] 12xPaw 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] 12xPaw 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] 12xPaw 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] 12xPaw 13merged pull request 12#6 from 12xPaw to 06master: test pull request. 02https://github.com/xPaw/GitHub-WebHook/pull/6
2 |
--------------------------------------------------------------------------------
/tests/events/gollum/expected.bin:
--------------------------------------------------------------------------------
1 | [10ValveResourceFormat] 12xPaw 09edited _Sidebar: 02https://github.com/SteamDatabase/ValveResourceFormat/wiki/_Sidebar/_compare/94b8720e6a96a73ddbb639b06e5b29b98eb81a36
2 |
--------------------------------------------------------------------------------
/tests/events/issue_comment/expected.bin:
--------------------------------------------------------------------------------
1 | [10GitHub-WebHook] 12xPaw 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] 12xPaw 09published a pre-release 06Some cool fixes: 02https://github.com/SteamDatabase/ValveResourceFormat/releases/tag/0.0.4
2 |
--------------------------------------------------------------------------------
/tests/events/pull_request_auto_merge_enabled/expected.bin:
--------------------------------------------------------------------------------
1 | [10ValveResourceFormat] 12xPaw 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] 12xPaw 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] 12dependabot[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] 12Codertocat 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] 12xPaw pushed 121 new commit to 06master: 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] 12xPaw created 06hello-world from 06master 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] 12xPaw tagged 060.0.4 at 06master 02https://github.com/SteamDatabase/ValveResourceFormat/compare/0000000000000000000000000000000000000000..291b9dd498f2e61f9e26981aef691166c23a80a4
2 |
--------------------------------------------------------------------------------
/tests/events/push_no_author/expected.bin:
--------------------------------------------------------------------------------
1 | [10DotaTracking] 12SinZ163 pushed 121 new commit to 06master: 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] 12Codertocat 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] 12xPaw 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] 12lewa-j created 06fix_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