Skip to content

Commit 283a4a8

Browse files
Add configurable ImportantFilesPatterns setting to README documentation
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
1 parent d5a309a commit 283a4a8

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
6969
- [Permissions](#permissions)
7070
- [Scenario Matrix](#scenario-matrix)
7171
- [Important file change detection](#important-file-change-detection)
72-
- [Files that trigger releases](#files-that-trigger-releases)
72+
- [Default files that trigger releases](#default-files-that-trigger-releases)
73+
- [Customizing important file patterns](#customizing-important-file-patterns)
7374
- [Files that do NOT trigger releases](#files-that-do-not-trigger-releases)
7475
- [Behavior when no important files are changed](#behavior-when-no-important-files-are-changed)
7576
- [Configuration](#configuration)
@@ -371,16 +372,40 @@ The workflow automatically detects whether a pull request contains changes to "i
371372
release. This prevents unnecessary releases when only non-functional files (such as workflow configurations, linter
372373
settings, or test files) are modified.
373374

374-
#### Files that trigger releases
375+
#### Default files that trigger releases
375376

376-
| Path | Description |
377-
| :--- | :---------- |
378-
| `src/**` | Module source code |
379-
| `README.md` | Module documentation |
377+
By default, the following file patterns are considered important and will trigger a release:
378+
379+
| Pattern | Description |
380+
| :------ | :---------- |
381+
| `^src/` | Module source code |
382+
| `^README\.md$` | Module documentation |
383+
384+
These patterns are regular expressions matched against the file paths changed in a pull request.
385+
386+
#### Customizing important file patterns
387+
388+
You can override the default patterns using the `Publish.Module.ImportantFilesPatterns` setting in your
389+
`PSModule.yml` file. The value is a comma-separated list of regular expression patterns:
390+
391+
```yaml
392+
Publish:
393+
Module:
394+
ImportantFilesPatterns: '^src/, ^README\.md$'
395+
```
396+
397+
For example, to also trigger releases when example scripts or a changelog are modified:
398+
399+
```yaml
400+
Publish:
401+
Module:
402+
ImportantFilesPatterns: '^src/, ^README\.md$, ^examples/, ^CHANGELOG\.md$'
403+
```
380404

381405
#### Files that do NOT trigger releases
382406

383-
Changes to the following files will not trigger a release:
407+
Changes to files that do not match any of the important file patterns will not trigger a release.
408+
With the default patterns, this includes:
384409

385410
- `.github/workflows/*` - Workflow configurations
386411
- `.github/linters/*` - Linter configuration files
@@ -448,6 +473,7 @@ The following settings are available in the settings file:
448473
| `Publish.Module.UsePRTitleAsReleaseName` | `Boolean` | Use the PR title as the GitHub release name instead of version string | `false` |
449474
| `Publish.Module.UsePRBodyAsReleaseNotes` | `Boolean` | Use the PR body as the release notes content | `true` |
450475
| `Publish.Module.UsePRTitleAsNotesHeading` | `Boolean` | Prepend PR title as H1 heading with PR number link before the body | `true` |
476+
| `Publish.Module.ImportantFilesPatterns` | `String` | Comma-separated list of regex patterns for files that trigger a release (see [Important file change detection](#important-file-change-detection)) | `'^src/, ^README\.md$'` |
451477
| `Linter.Skip` | `Boolean` | Skip repository linting | `false` |
452478
| `Linter.ShowSummaryOnSuccess` | `Boolean` | Show super-linter summary on success for repository linting | `false` |
453479
| `Linter.env` | `Object` | Environment variables for super-linter configuration | `{}` |
@@ -519,6 +545,7 @@ Publish:
519545
MinorLabels: 'minor, feature'
520546
PatchLabels: 'patch, fix'
521547
IgnoreLabels: 'NoRelease'
548+
ImportantFilesPatterns: '^src/, ^README\.md$'
522549
UsePRTitleAsReleaseName: false
523550
UsePRBodyAsReleaseNotes: true
524551
UsePRTitleAsNotesHeading: true

0 commit comments

Comments
 (0)