Skip to content

[BUG]: dependabot_alert events fail to verify #775

@timomeh

Description

@timomeh

What happened?

Observed Behavior

I noticed that webhooks.verify() returns false for dependabot_alert events, but only for this event type. All other events verify successfully.

To reproduce, I created a small script:

import { Webhooks } from '@octokit/webhooks'

const webhooks = new Webhooks({ secret: 'redacted' })

const check_run_event = {
  sign: "sha256=redacted", // from the X-Hub-Signature-256 header of the check_run event
  data: { /* copied a check_run event payload from the App Settings */ }
}
const dependabot_alert_event = {
  sign: "sha256=redacted", // from the X-Hub-Signature-256 header of the dependabot_alert event
  data: { /* copied a dependabot_alert event payload from the App Settings */ }
}

await webhooks.verify(dependabot_alert_event.data, dependabot_alert_event.sign)
// -> false

await webhooks.verify(check_run_event.data, check_run_event.sign)
// -> true

Expected Behavior

Given that other events verify successfully, I would've expected that the dependabot_alert event also verifies successfully.

Note

I'm unsure if this is a bug of @octokit/webhooks, or maybe even a miscalculation of the X-Hub-Signature-256 header coming from GitHub-Hookshot. In case it really seems to be an issue of Github-Hookshot, where can I report this?

I'm aware that the dependabot_alert event is still in beta.

Versions

@octokit/webhooks v10.3.1

Relevant log output

No logs are printed

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as documented, or is being fixedreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions