Skip to content

feat: support glob patterns for workflows and exclude-workflows inputs#63

Merged
joshjohanning merged 7 commits into
mainfrom
copilot/support-glob-patterns-workflows
Apr 10, 2026
Merged

feat: support glob patterns for workflows and exclude-workflows inputs#63
joshjohanning merged 7 commits into
mainfrom
copilot/support-glob-patterns-workflows

Conversation

Copilot AI commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

workflows and exclude-workflows inputs only accepted exact filenames. This adds glob pattern support via minimatch so users can match flexibly:

# Include only deploy workflows
workflows: 'deploy-*.yml'

# Exclude experimental workflows
exclude-workflows: 'experimental-*.yml'

# Mix exact names and globs
workflows: 'ci.yml,deploy-*.yml'

Changes

  • src/index.js: Added matchesPattern() helper using minimatch. Rewrote getWorkflowFiles() to match workflows patterns against all files in the directory (instead of checking fs.existsSync per entry) and to use pattern matching for exclude-workflows filtering (instead of Array.includes). Exact filenames still work — minimatch matches them identically.
  • package.json: Added minimatch@^10.2.5 production 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.

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
Copilot AI requested a review from joshjohanning April 10, 2026 04:54
@joshjohanning joshjohanning marked this pull request as ready for review April 10, 2026 14:25
Copilot AI review requested due to automatic review settings April 10, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 by minimatch) 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 minimatch dependency.
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

Comment thread src/index.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 workflows and exclude-workflows inputs using minimatch, 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 minimatch as 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

@joshjohanning joshjohanning changed the title Support glob patterns for workflows and exclude-workflows inputs feat: support glob patterns for workflows and exclude-workflows inputs Apr 10, 2026
@joshjohanning joshjohanning merged commit dc19f8b into main Apr 10, 2026
4 checks passed
@joshjohanning joshjohanning deleted the copilot/support-glob-patterns-workflows branch April 10, 2026 15:01
@github-actions

Copy link
Copy Markdown

📦 Draft Release Created

A draft release v2.5.0 has been created for this PR.

🔗 View Draft Release

Next Steps

  • Review the release notes
  • Publish the release to make it permanent

This is an automated reminder from the publish-github-action workflow.

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.

Support glob patterns for workflows and exclude-workflows inputs

3 participants