Skip to content

file-issues: auto-create missing labels instead of failing #25

Description

@benthomasson

Summary

code-expert file-issues fails for every issue when the target repo doesn't have the required labels (reasons-gate, reasons-negative). The gh issue create call errors with could not add label: 'reasons-gate' not found and the entire batch produces 0 filed issues.

Expected behavior

Before filing issues, file-issues should check whether the required labels exist on the target repo and create any that are missing (via gh label create). This way the command works out of the box against any repo without manual label setup.

Current behavior

All issues fail with label-not-found errors. The user must manually run gh label create for each label before retrying.

Suggested fix

Before the filing loop, add a label-ensure step:

  1. List existing labels on the target repo (gh label list)
  2. For any required label not present, create it (gh label create)
  3. Proceed with filing

This is a one-time check per invocation, not per-issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions