Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
🚀 [Feature]: Release-triggering file patterns now configurable via workflow input#301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
918b8e01bf05fba98b0c5dbe3a5b4012bb07f37f2ab0c0691790ad67386b01fab5c1a3d94e96903c2bef66ce1dcc60f3f21890a9f01f80afFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -32,6 +32,16 @@ on: | ||
| description: The path to the root of the repo. | ||
| required: false | ||
| default: '.' | ||
| ImportantFilePatterns: | ||
| type: string | ||
| description: | | ||
| Newline-separated list of regex patterns that identify important files. | ||
| Changes matching these patterns trigger build, test, and publish stages. | ||
| When set, fully replaces the defaults (^src/ and ^README\.md$). | ||
| required: false | ||
| default: | | ||
| ^src/ | ||
| ^README\.md$ | ||
MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| outputs: | ||
| Settings: | ||
| @@ -56,7 +66,7 @@ jobs: | ||
| fetch-depth: 0 | ||
| - name: Get-Settings | ||
| uses: PSModule/Get-PSModuleSettings@21c88f499579f56a60cced37872089d866b94a66 # v1.4.4 | ||
| uses: PSModule/Get-PSModuleSettings@1e3d156786c56e6fbd839a1ba5ab21ff8858090e # v1.5.0 | ||
| id: Get-Settings | ||
| with: | ||
| SettingsPath: ${{ inputs.SettingsPath }} | ||
| @@ -65,3 +75,4 @@ jobs: | ||
| Verbose: ${{ inputs.Verbose }} | ||
| Version: ${{ inputs.Version }} | ||
| WorkingDirectory: ${{ inputs.WorkingDirectory }} | ||
| ImportantFilePatterns: ${{ inputs.ImportantFilePatterns }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -58,6 +58,16 @@ on: | ||
| description: The path to the root of the repo. | ||
| required: false | ||
| default: '.' | ||
| ImportantFilePatterns: | ||
| type: string | ||
| description: | | ||
| Newline-separated list of regex patterns that identify important files. | ||
| Changes matching these patterns trigger build, test, and publish stages. | ||
| When set, fully replaces the defaults (^src/ and ^README\.md$). | ||
| required: false | ||
MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| default: | | ||
| ^src/ | ||
| ^README\.md$ | ||
MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| permissions: | ||
| contents: write # to checkout the repo and create releases on the repo | ||
| @@ -81,6 +91,7 @@ jobs: | ||
| Verbose: ${{ inputs.Verbose }} | ||
| Version: ${{ inputs.Version }} | ||
| WorkingDirectory: ${{ inputs.WorkingDirectory }} | ||
| ImportantFilePatterns: ${{ inputs.ImportantFilePatterns }} | ||
| # Runs on: | ||
| # - ✅ Open/Updated PR - Lints code changes in active PRs | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -75,7 +75,7 @@ Depending on the labels in the pull requests, the [workflow will result in diffe | ||
| - [Scenario Matrix](#scenario-matrix) | ||
| - [Important file change detection](#important-file-change-detection) | ||
| - [Files that trigger releases](#files-that-trigger-releases) | ||
| - [Files that do NOT trigger releases](#files-that-do-not-trigger-releases) | ||
| - [Customizing important file patterns](#customizing-important-file-patterns) | ||
| - [Behavior when no important files are changed](#behavior-when-no-important-files-are-changed) | ||
| - [Configuration](#configuration) | ||
| - [Example 1 - Defaults with Code Coverage target](#example-1---defaults-with-code-coverage-target) | ||
| @@ -392,6 +392,7 @@ jobs: | ||
| | `Version` | `string` | Specifies the version of the GitHub module to be installed. The value must be an exact version. | `false` | `''` | | ||
| | `Prerelease` | `boolean` | Whether to use a prerelease version of the 'GitHub' module. | `false` | `false` | | ||
| | `WorkingDirectory` | `string` | The path to the root of the repo. | `false` | `'.'` | | ||
| | `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/\n^README\.md$` | | ||
| ### Secrets | ||
| @@ -458,26 +459,69 @@ settings, or test files) are modified. | ||
| #### Files that trigger releases | ||
| | Path | Description | | ||
| By default, the following regular expression patterns identify important files: | ||
| | Pattern | Description | | ||
| | :--- | :---------- | | ||
| | `src/**` | Module source code | | ||
| | `README.md` | Module documentation | | ||
| | `^src/` | Module source code | | ||
| | `^README\.md$` | Module documentation | | ||
MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| #### Customizing important file patterns | ||
| To override the default patterns, set `ImportantFilePatterns` in your settings file (`.github/PSModule.yml`): | ||
| ```yaml | ||
MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ImportantFilePatterns: | ||
| - '^src/' | ||
| - '^README\.md$' | ||
| - '^examples/' | ||
MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ``` | ||
| #### Files that do NOT trigger releases | ||
| When configured, the provided list fully replaces the defaults. Include the default patterns in your list if you still | ||
| want them to trigger releases. | ||
MariusStorhaug marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Changes to the following files will not trigger a release: | ||
| To disable file-change triggering entirely (so that no file changes ever trigger a release), set an empty list in the | ||
| settings file: | ||
| - `.github/workflows/*` - Workflow configurations | ||
| - `.github/linters/*` - Linter configuration files | ||
| - `tests/**` - Test files | ||
| - `examples/**` - Example scripts | ||
| - `.gitignore`, `.editorconfig`, etc. - Repository configuration files | ||
| ```yaml | ||
| ImportantFilePatterns: [] | ||
| ``` | ||
| You can also pass patterns via the workflow input: | ||
| ```yaml | ||
| jobs: | ||
| Process: | ||
| uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5 | ||
| with: | ||
| ImportantFilePatterns: | | ||
| ^src/ | ||
| ^README\.md$ | ||
| ^examples/ | ||
| ``` | ||
| To disable triggering via the workflow input, pass an explicit empty string: | ||
| ```yaml | ||
| jobs: | ||
| process: | ||
| uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5 | ||
| with: | ||
| ImportantFilePatterns: '' | ||
| ``` | ||
| Note that omitting the `ImportantFilePatterns` key entirely causes the workflow's default patterns (`^src/` and | ||
| `^README\.md$`) to be used. The settings file takes priority over the workflow input, so set | ||
| `ImportantFilePatterns: []` in `.github/PSModule.yml` to disable triggering regardless of the workflow input. | ||
| Resolution order: settings file → workflow input → workflow input default values. | ||
| #### Behavior when no important files are changed | ||
| When a pull request does not contain changes to important files: | ||
| 1. A comment is automatically added to the PR explaining why build/test stages are skipped | ||
| 1. A comment is automatically added to the PR listing the configured patterns and explaining why build/test stages are | ||
| skipped | ||
| 2. The `ReleaseType` output is set to `None` | ||
| 3. Build, test, and publish stages are skipped | ||
| 4. The PR can still be merged for non-release changes (documentation updates, CI improvements, etc.) | ||
| @@ -495,6 +539,7 @@ The following settings are available in the settings file: | ||
| | Name | Type | Description | Default | | ||
| | ----------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | | ||
| | `Name` | `String` | Name of the module to publish. Defaults to the repository name. | `null` | | ||
| | `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$']` | | ||
| | `Test.Skip` | `Boolean` | Skip all tests | `false` | | ||
| | `Test.Linux.Skip` | `Boolean` | Skip tests on Linux | `false` | | ||
| | `Test.MacOS.Skip` | `Boolean` | Skip tests on macOS | `false` | | ||
| @@ -543,6 +588,10 @@ The following settings are available in the settings file: | ||
| ```yaml | ||
| Name: null | ||
| ImportantFilePatterns: | ||
| - '^src/' | ||
| - '^README\.md$' | ||
| Build: | ||
| Skip: false | ||
| Module: | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.