Skip to content

Conversation

@ncalteen
Copy link
Contributor

@ncalteen ncalteen commented Jul 30, 2025

This pull request introduces a major update to the label management action, adding support for glob pattern-based label removal and refining input validation. The changes enhance functionality, improve error handling, and update the version to 3.0.0. Below are the most important changes grouped by theme.

Label Management Enhancements:

  • Added support for label_patterns input to allow removal of labels matching specified glob patterns.
  • Updated the labels and label_patterns inputs to be optional, with validation ensuring at least one is provided for removal operations.

Input Validation Improvements:

  • Enhanced input handling by trimming whitespace and ensuring empty inputs are ignored. Added warnings for unsupported combinations, such as label_patterns with the add action.
  • Added error handling for scenarios where no labels or patterns are provided for removal, or no labels are provided for addition.

Test Coverage Expansion:

  • Added new test cases to validate the behavior of label_patterns, including matching patterns, empty inputs, and unsupported combinations.
  • Mocked the get method in octokit to simulate fetching existing labels for pattern matching.

Documentation Updates:

  • Updated README.md to reflect the new functionality, including examples of how label_patterns can be used alongside traditional label inputs.

Versioning:

  • Bumped the package version to 3.0.0 to indicate breaking changes and new features.

@ncalteen ncalteen self-assigned this Jul 30, 2025
Copilot AI review requested due to automatic review settings July 30, 2025 19:18
@ncalteen ncalteen requested a review from a team as a code owner July 30, 2025 19:18

This comment was marked as outdated.

@github-actions
Copy link

github-actions bot commented Jul 30, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.04s
✅ JSON jsonlint 5 0 0 0.2s
✅ JSON npm-package-json-lint yes no no 0.55s
✅ JSON prettier 5 0 0 0.8s
✅ JSON v8r 5 0 0 8.8s
✅ MARKDOWN markdownlint 1 0 0 0.65s
✅ MARKDOWN markdown-link-check 1 0 0 1.81s
✅ REPOSITORY checkov yes no no 19.27s
✅ REPOSITORY gitleaks yes no no 0.91s
✅ REPOSITORY git_diff yes no no 0.06s
✅ REPOSITORY grype yes no no 39.12s
✅ REPOSITORY secretlint yes no no 1.19s
✅ REPOSITORY syft yes no no 7.16s
✅ REPOSITORY trivy-sbom yes no no 2.02s
✅ REPOSITORY trufflehog yes no no 25.1s
✅ TYPESCRIPT prettier 9 0 0 1.34s
✅ YAML prettier 13 0 0 0.74s
✅ YAML v8r 13 0 0 6.89s
✅ YAML yamllint 13 0 0 0.72s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@ncalteen ncalteen changed the title Add label regex support for removal Add label glob pattern support for removal Jul 31, 2025
ncalteen added 3 commits July 31, 2025 13:09
- Added a new script "local-action" to package.json for running local GitHub actions.
- Updated dependencies: added "minimatch" and "@github/local-action" to package.json.
@ncalteen ncalteen requested a review from Copilot July 31, 2025 17:10

This comment was marked as outdated.

@ncalteen ncalteen requested a review from Copilot July 31, 2025 17:14

This comment was marked as outdated.

@ncalteen ncalteen requested a review from Copilot July 31, 2025 17:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces glob pattern support for label removal, expanding the action's functionality to allow pattern-based label matching and removal. The changes maintain backward compatibility while adding significant new capabilities.

  • Adds label_patterns input for glob-based label matching during removal operations
  • Updates input validation to make labels optional and adds comprehensive error handling
  • Implements pattern matching using the minimatch library for flexible label removal

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main.ts Implements core pattern matching logic and enhanced input validation
action.yml Adds new label_patterns input parameter and makes labels optional
package.json Bumps version to 3.0.0 and adds minimatch dependency
tests/main.test.ts Adds comprehensive test coverage for new pattern matching features
fixtures/octokit.ts Adds mock for issues.get method to support pattern matching tests
README.md Updates documentation with examples and behavior descriptions for new features

@ncalteen ncalteen merged commit 065f5b9 into main Jul 31, 2025
5 checks passed
@ncalteen ncalteen deleted the ncalteen/regex branch July 31, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants