Skip to content

event.name type/value disagreement #431

@jablko

Description

@jablko

I get TS2367: This condition will always return 'false' since the types '"check_run.completed" | "code_scanning_alert.fixed"' and '"check_run"' have no overlap. from the following since 7.22.0/#406:

on(["check_run.completed", "code_scanning_alert.fixed"], (event) => {
  if (event.name === "check_run") {
    console.log(`a run was ${event.payload.action}!`);
  }
});

I confirmed this wasn't an error in 7.21.0.

Thanks for the work in #406 to upgrade the types! ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: SupportAny questions, information, or general needs around the SDK or GitHub APIstypescriptRelevant to TypeScript users only

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions