Skip to content

Commit 1bf05fb

Browse files
Document ImportantFilePatterns in README
1 parent 918b8e0 commit 1bf05fb

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

README.md

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ jobs:
381381
| `Version` | `string` | Specifies the version of the GitHub module to be installed. The value must be an exact version. | `false` | `''` |
382382
| `Prerelease` | `boolean` | Whether to use a prerelease version of the 'GitHub' module. | `false` | `false` |
383383
| `WorkingDirectory` | `string` | The path to the root of the repo. | `false` | `'.'` |
384+
| `ImportantFilePatterns` | `string` | Newline-separated list of regular expression patterns that identify important files. Changes matching these patterns trigger build, test, and publish stages. When set, fully replaces the defaults. | `false` | `^src/` and `^README\.md$` |
384385

385386
### Secrets
386387

@@ -445,12 +446,43 @@ The workflow automatically detects whether a pull request contains changes to "i
445446
release. This prevents unnecessary releases when only non-functional files (such as workflow configurations, linter
446447
settings, or test files) are modified.
447448

448-
#### Files that trigger releases
449+
#### Default patterns
449450

450-
| Path | Description |
451+
By default, the following regular expression patterns identify important files:
452+
453+
| Pattern | Description |
451454
| :--- | :---------- |
452-
| `src/**` | Module source code |
453-
| `README.md` | Module documentation |
455+
| `^src/` | Module source code |
456+
| `^README\.md$` | Module documentation |
457+
458+
#### Customizing important file patterns
459+
460+
To override the default patterns, set `ImportantFilePatterns` in your settings file (`.github/PSModule.yml`):
461+
462+
```yaml
463+
ImportantFilePatterns:
464+
- '^src/'
465+
- '^README\.md$'
466+
- '^examples/'
467+
```
468+
469+
When configured, the provided list fully replaces the defaults. Include the default patterns in your list if you still
470+
want them to trigger releases.
471+
472+
You can also pass patterns via the workflow input:
473+
474+
```yaml
475+
jobs:
476+
Process:
477+
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v1
478+
with:
479+
ImportantFilePatterns: |
480+
^src/
481+
^README\.md$
482+
^examples/
483+
```
484+
485+
Resolution order: settings file → workflow input → hardcoded defaults.
454486

455487
#### Files that do NOT trigger releases
456488

@@ -459,14 +491,14 @@ Changes to the following files will not trigger a release:
459491
- `.github/workflows/*` - Workflow configurations
460492
- `.github/linters/*` - Linter configuration files
461493
- `tests/**` - Test files
462-
- `examples/**` - Example scripts
463494
- `.gitignore`, `.editorconfig`, etc. - Repository configuration files
464495

465496
#### Behavior when no important files are changed
466497

467498
When a pull request does not contain changes to important files:
468499

469-
1. A comment is automatically added to the PR explaining why build/test stages are skipped
500+
1. A comment is automatically added to the PR listing the configured patterns and explaining why build/test stages are
501+
skipped
470502
2. The `ReleaseType` output is set to `None`
471503
3. Build, test, and publish stages are skipped
472504
4. The PR can still be merged for non-release changes (documentation updates, CI improvements, etc.)
@@ -484,6 +516,7 @@ The following settings are available in the settings file:
484516
| Name | Type | Description | Default |
485517
| ----------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
486518
| `Name` | `String` | Name of the module to publish. Defaults to the repository name. | `null` |
519+
| `ImportantFilePatterns` | `Array` | Regular expression patterns that identify important files. Changes matching these patterns trigger build, test, and publish stages. When set, fully replaces the defaults. | `['^src/', '^README\.md$']` |
487520
| `Test.Skip` | `Boolean` | Skip all tests | `false` |
488521
| `Test.Linux.Skip` | `Boolean` | Skip tests on Linux | `false` |
489522
| `Test.MacOS.Skip` | `Boolean` | Skip tests on macOS | `false` |
@@ -532,6 +565,10 @@ The following settings are available in the settings file:
532565
```yaml
533566
Name: null
534567
568+
ImportantFilePatterns:
569+
- '^src/'
570+
- '^README\.md$'
571+
535572
Build:
536573
Skip: false
537574
Module:

0 commit comments

Comments
 (0)