Skip to content
Français

commandIssued

import { commandIssued } from "@elie-laloum/outpost";

Return the text after command on the first line of a newly created GitHub or GitLab comment that is or starts with it, or in a matching Slack slash command; otherwise undefined. Edited comments are ignored, and a command that is not a single word throws. It does not authorize the actor; compare event.actor with an allowlist.

Complete example and detailed rules.

  • eventRequired
    TriggerEvent
    Verified event from a GitHub, GitLab or Slack source.
  • commandRequired
    string
    Single word starting the command, such as /outpost; for Slack it must equal the slash command name. A value containing whitespace throws.

TriggerCommand | undefined

export declare function commandIssued(
  event: TriggerEvent,
  command: string,
): TriggerCommand | undefined;