Skip to content

🚀 [Feature]: Release-triggering file patterns now configurable#19

Merged
Marius Storhaug (MariusStorhaug) merged 8 commits intomainfrom
feature/configurable-important-file-patterns
Mar 28, 2026
Merged

🚀 [Feature]: Release-triggering file patterns now configurable#19
Marius Storhaug (MariusStorhaug) merged 8 commits intomainfrom
feature/configurable-important-file-patterns

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

Repositories can now configure which file changes trigger build, test, and publish stages. Previously, only changes to src/ and README.md were recognized as significant — this was hardcoded and could not be overridden. Repositories that ship additional important files (e.g., examples/, custom config) can now declare their own patterns through the settings file or the action input.

New: Configurable important file patterns

The ImportantFilePatterns setting accepts an array of regex patterns. When a PR changes only files that don't match any pattern, build/test/publish stages are skipped.

Via settings file (.github/PSModule.yml):

ImportantFilePatterns:
  - '^src/'
  - '^README\.md$'
  - '^examples/'

Via action input (newline-separated):

- uses: PSModule/Get-PSModuleSettings@v1
  with:
    ImportantFilePatterns: |
      ^src/
      ^README\.md$
      ^examples/

The setting fully replaces the defaults when configured. Include the default patterns in your list if you still want them.

Resolution order: settings file → action input → hardcoded fallback (^src/, ^README\.md$).

Changed: PR skip comment now reflects configured patterns

The PR comment posted when no important files changed now dynamically lists the actual patterns in effect, rather than a hardcoded table.

Technical Details

  • action.yml: Added ImportantFilePatterns input with newline-separated default and corresponding PSMODULE_GET_SETTINGS_INPUT_ImportantFilePatterns env var.
  • Settings.schema.json: Added top-level ImportantFilePatterns property as array of strings.
  • main.ps1: Added resolution logic (settings file → parsed input → hardcoded default). Replaced hardcoded $importantPatterns array with $settings.ImportantFilePatterns. Refactored PR comment to generate the pattern table dynamically.
  • README.md: Documented the new input and settings file property with examples.

@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review March 27, 2026 23:52
Copilot AI review requested due to automatic review settings March 27, 2026 23:52
Copy link
Copy Markdown
Contributor

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

Adds repository-configurable “important file” regex patterns to decide whether build/test/publish stages should run for a PR, replacing the previously hardcoded src/ + README.md checks.

Changes:

  • Introduces ImportantFilePatterns as a new action input (newline-separated) and settings-file property (array of regex strings).
  • Implements settings resolution in main.ps1 (settings file → action input → hardcoded fallback) and wires the resolved patterns into the returned settings object.
  • Updates the “no significant changes” PR comment to list the configured patterns dynamically.

Reviewed changes

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

File Description
src/main.ps1 Resolves configurable important file patterns, uses them for change detection, and renders them in the PR skip comment.
src/Settings.schema.json Adds schema support for ImportantFilePatterns as an array of strings.
action.yml Adds ImportantFilePatterns input and passes it through via env var to main.ps1.
README.md Documents the new input and settings-file configuration with examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 28, 2026 00:03
Copy link
Copy Markdown
Contributor

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 28, 2026 00:17
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MariusStorhaug
Copy link
Copy Markdown
Member Author

Copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

Copilot apply changes based on the comments in this thread

Fixed in 41cbece. Changed '``' * ($maxRun + 1) to '' * ($maxRun + 1)so the code-span delimiter is exactly($maxRun + 1)` single backticks — matching the "one more than the longest run" intent.

@MariusStorhaug Marius Storhaug (MariusStorhaug) deleted the feature/configurable-important-file-patterns branch March 28, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make release-triggering file patterns configurable via settings file

3 participants