Add GitHub Actions workflow for issue labeling

Merged
40
2mo ago
+80-0

This pull request introduces a new GitHub Actions workflow to automate issue labeling using the OpenCode AI tool. The workflow is triggered when an issue is opened or manually via workflow dispatch, and it applies appropriate labels to issues by analyzing their content and the repository's existing labels.

New Issue Labeling Workflow:

  • Workflow Automation:

    • Adds a new workflow .github/workflows/issue-label.yml that automatically labels issues when they are opened or when triggered manually.
  • Integration with OpenCode AI:

    • Installs and uses the opencode-ai tool to analyze issue content and select the most fitting labels from the repository’s existing label set.
    • Passes strict permissions to ensure the workflow can only view and edit issue labels, with no ability to comment, edit files, or access the web.
  • Label Selection Logic:

    • Fetches the current list of labels, reads the issue’s title and body, and applies 1-3 of the most relevant labels, following clear rules to avoid creating or removing labels.
  • Manual Trigger Support:

    • Supports manual relabeling of issues via workflow dispatch with an issue_number input.

Summary by CodeRabbit

  • New Features
    • Issues can now be automatically labeled when opened, with an option to run labeling manually for a specific issue. The workflow applies up to three relevant existing labels and leaves the issue unchanged when no label is a clear fit.