feat: support glob patterns for workflows and exclude-workflows inputs#63
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/joshjohanning/ensure-immutable-actions/sessions/0b83fbee-97a7-43a5-bb91-07dcd951364d Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for glob patterns in workflows inputs
Support glob patterns for workflows and exclude-workflows inputs
Apr 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds glob pattern support for the workflows and exclude-workflows inputs in this Node.js GitHub Action, enabling more flexible selection of workflow files under .github/workflows.
Changes:
- Introduces
matchesPattern()(powered byminimatch) and updates workflow file discovery/filtering to support globs. - Updates docs (
README.md,action.yml) to describe glob usage and provide examples. - Adds/updates Jest tests for glob include/exclude, mixed patterns, and deduplication; bumps package version and adds
minimatchdependency.
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Adds matchesPattern() and rewrites getWorkflowFiles() to support glob matching for include/exclude inputs. |
__tests__/index.test.js |
Adds coverage for glob behavior, no-match warnings, and deduplication. |
action.yml |
Updates input descriptions to mention glob patterns. |
README.md |
Adds usage examples + updates inputs table to document glob support. |
package.json |
Adds minimatch prod dependency and bumps version to 2.5.0. |
package-lock.json |
Locks minimatch and related transitive dependency updates. |
badges/coverage.svg |
Updates coverage badge output. |
Copilot's findings
- Files reviewed: 5/7 changed files
- Comments generated: 1
Contributor
There was a problem hiding this comment.
Pull request overview
Adds glob-pattern support for selecting and excluding workflow files in this Node.js GitHub Action, enabling more flexible targeting of workflows under .github/workflows/ while keeping backward compatibility with exact filenames.
Changes:
- Implemented glob matching for
workflowsandexclude-workflowsinputs usingminimatch, including deduplication and clearer warnings when nothing matches. - Updated documentation (
README.md,action.yml) to describe glob usage and provide examples. - Added Jest coverage for glob include/exclude behavior and the new matcher helper; bumped version and added
minimatchas a production dependency.
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Adds matchesPattern() and updates getWorkflowFiles() to resolve workflow lists via glob matching against directory contents. |
__tests__/index.test.js |
Adds tests for glob includes/excludes, mixed patterns, deduplication, and invalid/no-match warnings; tests matchesPattern(). |
package.json |
Adds minimatch production dependency and bumps version to 2.5.0. |
package-lock.json |
Updates lockfile for minimatch and transitive dependencies consistent with the version bump. |
action.yml |
Updates input descriptions to state filenames or glob patterns are accepted. |
README.md |
Documents glob usage with new examples and updated input descriptions. |
badges/coverage.svg |
Updates coverage badge to reflect new test coverage. |
Copilot's findings
- Files reviewed: 5/7 changed files
- Comments generated: 0 new
📦 Draft Release CreatedA draft release v2.5.0 has been created for this PR. Next Steps
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
workflowsandexclude-workflowsinputs only accepted exact filenames. This adds glob pattern support viaminimatchso users can match flexibly:Changes
src/index.js: AddedmatchesPattern()helper usingminimatch. RewrotegetWorkflowFiles()to matchworkflowspatterns against all files in the directory (instead of checkingfs.existsSyncper entry) and to use pattern matching forexclude-workflowsfiltering (instead ofArray.includes). Exact filenames still work —minimatchmatches them identically.package.json: Addedminimatch@^10.2.5production dependency; version bump to 2.5.0.action.yml/README.md: Updated input descriptions and added usage examples for glob patterns.__tests__/index.test.js: Tests for glob include, glob exclude, mixed exact+glob, deduplication, and no-match warnings.