Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

Summary

Successfully implemented automated label management for all WP-CLI repositories, fulfilling issue #54.

✅ Completed Tasks

  • Create reusable workflow for managing standard labels (reusable-manage-labels.yml)
  • Create calling workflow for managing labels (manage-labels.yml)
  • Update sync-workflows.yml to distribute the calling workflow to all repositories
  • Test the workflow with actionlint (all workflows pass)
  • Validate workflow logic manually (tested with composer commands and JS)
  • Run security scan (CodeQL - no alerts)
  • Fix security issues (added explicit permissions)
  • Final verification and testing
  • Update command label color per code review feedback
  • Remove unused variable per code review feedback

📋 What This Implements

Standard Labels (created in every repository):

  • good-first-issue - Good for newcomers
  • help-wanted - Extra attention is needed
  • scope:documentation - Related to documentation
  • scope:testing - Related to testing

Command-Specific Labels (for repositories with WP-CLI commands):

  • Extracted from composer.json via composer config extra.commands
  • Format: command:<command-name> (spaces replaced with dashes)
  • Color: light blue (#C5DEF5)
  • Example: user application-password record-usagecommand:user-application-password-record-usage

🔧 How It Works

  1. Reusable workflow (reusable-manage-labels.yml):

    • Checks out repository code
    • Extracts commands from composer.json (if exists)
    • Creates/updates labels via GitHub API
    • Handles repositories without composer.json gracefully
  2. Calling workflow (manage-labels.yml):

    • Triggers on workflow_dispatch or composer.json changes
    • Synced to all 39 WP-CLI repositories via sync-workflows.yml
  3. Deployment:

    • Once merged, syncs to all repositories within ~10 minutes
    • Can be manually triggered anytime
    • Auto-runs when composer.json is updated

✅ Testing & Validation

  • Manual testing with various composer.json scenarios
  • actionlint: All workflows pass
  • CodeQL security scan: No alerts
  • Follows wp-cli/.github patterns (split reusable + calling workflow)
  • Edge cases handled (no composer.json, empty commands array)

📝 Notes

The workflow is idempotent and safe to run multiple times. It will update existing labels or create new ones as needed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Automatically apply standard labels to all repositories</issue_title>
<issue_description>We're no longer using Settings bot (#42 (comment)) but it would be nice to have consistent labels across all of our repositories.

Done is:

  • We've decided what our standard labels should be.
  • The labels are automatically generated for each repository.</issue_description>

<agent_instructions>Create a reusable workflow for adding labels for each repository. Look at existing code, as well as #164 and #167 for inspiration.

Every repository needs some standard labels. At the moment, these are:

  • good-first-issue
  • help-wanted
  • scope:documentation
  • scope:testing

There may be more in the future.

Additionally, for packages registering new WP-CLI commands, every command should have a corresponding label as well.

The list of commands can be extracted via composer config extra.commands (grabs them from the composer.json file)

The format of the command-specific label is command:<command>, with spaces replaced with dashes.

Example: the command user application-password record-usage gets the label command:user-application-password-record-usage</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Automatically apply standard labels to all repositories Add reusable workflow for automatic label management across repositories Nov 13, 2025

This comment was marked as resolved.

@swissspidy swissspidy marked this pull request as ready for review November 13, 2025 14:47
@swissspidy swissspidy requested a review from a team as a code owner November 13, 2025 14:47
Co-authored-by: Alain Schlesser <[email protected]>
@swissspidy swissspidy merged commit 22cfd29 into main Dec 12, 2025
11 checks passed
@swissspidy swissspidy deleted the copilot/create-standard-labels-workflow branch December 12, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically apply standard labels to all repositories

3 participants