|
| 1 | +# Initialize-PSModule |
| 2 | + |
| 3 | +An action that is used to prepare the runner for PSModule framework. |
| 4 | + |
| 5 | +This GitHub Action is a part of the [PSModule framework](https://github.com/PSModule). It is recommended to use the [Process-PSModule workflow](https://github.com/PSModule/Process-PSModule) to automate the whole process of managing the PowerShell module. |
| 6 | + |
| 7 | +## Specifications and practices |
| 8 | + |
| 9 | +Initialize-PSModule follows: |
| 10 | + |
| 11 | +- [SemVer 2.0.0 specifications](https://semver.org) |
| 12 | +- [GitHub Flow specifications](https://docs.github.com/en/get-started/using-github/github-flow) |
| 13 | +- [Continuous Delivery practices](https://en.wikipedia.org/wiki/Continuous_delivery) |
| 14 | + |
| 15 | +... and supports the following practices in the PSModule framework: |
| 16 | + |
| 17 | +- [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) |
| 18 | + |
| 19 | +## How it works |
| 20 | + |
| 21 | +The Initialize-PSModule action will prepare the runner for the PSModule framework by installing the following dependencies: |
| 22 | + |
| 23 | +| Module | Description | |
| 24 | +| --- | --- | |
| 25 | +| GitHub | Used to interact with the GitHub API and GitHub Action workflow commands. | |
| 26 | +| PSScriptAnalyzer | Used to lint and format PowerShell code. | |
| 27 | +| PSSemVer | Used to create an object for the semantic version numbers. Has functionality to compare, and bump versions. | |
| 28 | +| Pester | Used for testing PowerShell code. | |
| 29 | +| Utilities | Used by all actions, contains common function and classes. | |
| 30 | +| platyPS | Used to generate Markdown documentation from PowerShell code. | |
| 31 | +| powershell-yaml | Used to parse and serialize YAML files, typically for reading configuration files. | |
| 32 | + |
| 33 | +## Usage |
| 34 | + |
| 35 | +### Inputs |
| 36 | + |
| 37 | +| Name | Description | Required | Default | |
| 38 | +| - | - | - | - | |
| 39 | +| `Debug` | Enable debug output. | `false` | `'false'` | |
| 40 | +| `Verbose` | Enable verbose output. | `false` | `'false'` | |
| 41 | +| `Version` | Specifies the version of the GitHub module to be installed. Accepts an exact version or a NuGet version range (for example '[1.2.0, 2.0.0)'). | `false` | | |
| 42 | +| `Prerelease` | Allow prerelease versions if available. | `false` | `'false'` | |
| 43 | +| `WorkingDirectory` | The working directory where the script runs. | `false` | `${{ github.workspace }}` | |
| 44 | + |
| 45 | +## Example |
| 46 | + |
| 47 | +The action can be used in a workflow to prepare the runner for the PSModule framework by adding it at the start of the workflow. |
| 48 | + |
| 49 | +```yaml |
| 50 | +name: Process-PSModule |
| 51 | + |
| 52 | +on: [push] |
| 53 | + |
| 54 | +jobs: |
| 55 | + Process-PSModule: |
| 56 | + name: Process module |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - name: Checkout Code |
| 60 | + uses: actions/checkout@v4 |
| 61 | + |
| 62 | + - name: Initialize environment |
| 63 | + uses: PSModule/Initialize-PSModule@main |
| 64 | +``` |
| 65 | +
|
| 66 | +## Permissions |
| 67 | +
|
| 68 | +The action does not require any permissions. |
| 69 | +
|
| 70 | +## Compatibility |
| 71 | +
|
| 72 | +The action is compatible with the following configurations: |
| 73 | +
|
| 74 | +| OS | Shell | |
| 75 | +| --- | --- | |
| 76 | +| windows-latest | pwsh | |
| 77 | +| macos-latest | pwsh | |
| 78 | +| ubuntu-latest | pwsh | |
0 commit comments