INNER CODE UNIT · TypeScript

run

peter-evans/slash-command-dispatch · src/main.ts:15

async function run(): Promise<void> {
  try {
    // Check required context properties exist (satisfy type checking)
    if (
      !github.context.payload.action ||
      !github.context.payload.issue ||
      !github.context.payload.comment
    ) {
      throw new Error('Required context properties are missing.')
    }

    // Only handle 'created' and 'edited' event types
    if (!['created', 'edited'].includes(github.context.payload.action)) {
      core.warning(
        `Event type '${github.context.payload.action}' not supported.`
      )
      return
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…