Skip to content

Commit

Permalink
Add GitHub App event security_advisory (#2799)
Browse files Browse the repository at this point in the history
Fixes: #2798.
  • Loading branch information
lukehinds authored Jun 6, 2023
1 parent 78b84df commit 5a9f8f7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions github/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) {
payload = &RepositoryVulnerabilityAlertEvent{}
case "SecretScanningAlertEvent":
payload = &SecretScanningAlertEvent{}
case "SecurityAdvisoryEvent":
payload = &SecurityAdvisoryEvent{}
case "StarEvent":
payload = &StarEvent{}
case "StatusEvent":
Expand Down
1 change: 1 addition & 0 deletions github/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ var (
"repository_vulnerability_alert": "RepositoryVulnerabilityAlertEvent",
"release": "ReleaseEvent",
"secret_scanning_alert": "SecretScanningAlertEvent",
"security_advisory": "SecurityAdvisoryEvent",
"star": "StarEvent",
"status": "StatusEvent",
"team": "TeamEvent",
Expand Down
4 changes: 4 additions & 0 deletions github/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ func TestParseWebHook(t *testing.T) {
payload: &SecretScanningAlertEvent{},
messageType: "secret_scanning_alert",
},
{
payload: &SecurityAdvisoryEvent{},
messageType: "security_advisory",
},
{
payload: &StarEvent{},
messageType: "star",
Expand Down
1 change: 1 addition & 0 deletions github/repos_hooks_deliveries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{
"repository_import": &RepositoryImportEvent{},
"repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{},
"secret_scanning_alert": &SecretScanningAlertEvent{},
"security_advisory": &SecurityAdvisoryEvent{},
"star": &StarEvent{},
"status": &StatusEvent{},
"team": &TeamEvent{},
Expand Down

0 comments on commit 5a9f8f7

Please sign in to comment.