Skip to content

Add Issue/PR label management cmdlets (Add-GitHubIssueLabel, Remove-GitHubIssueLabel) #655

Description

Summary

The module has no cmdlets for managing labels on issues or pull requests. Scripts that need to add labels to a newly-created PR must call \Invoke-GitHubAPI\ directly.

Use cases observed in the wild

  • PSModule/Distributor uses \Invoke-GitHubAPI -Method POST -ApiEndpoint /repos/.../issues/{number}/labels\ to add a \NoRelease\ label after PR creation
  • MSXOrg/Custo has the same pattern

Proposed cmdlets

\\powershell
Add-GitHubIssueLabel -Owner -Repository -IssueNumber -Labels <string[]> [-Context ]
Remove-GitHubIssueLabel -Owner -Repository -IssueNumber -Label [-Context ]
Get-GitHubIssueLabel -Owner -Repository -IssueNumber [-Context ]
\\

GitHub's API treats PRs as issues for label operations, so these would cover both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions