An action that is used to prepare the runner for PSModule framework.
This GitHub Action is a part of the PSModule framework. It is recommended to use the Process-PSModule workflow to automate the whole process of managing the PowerShell module.
Initiate-PSModule follows:
... and supports the following practices in the PSModule framework:
The Initialize-PSModule action will prepare the runner for the PSModule framework by installing the following dependencies:
Module | Description |
---|---|
Utilities | Used by all actions, contains common function and classes such as logging and grouping. |
PSSemVer | Used to create an object for the semantic version numbers. Has functionality to compare, and bump versions. |
powershell-yaml | Used to parse and serialize YAML files, typically for reading configuration files. |
Pester | Used for testing PowerShell code. |
PSScriptAnalyzer | Used to lint and format PowerShell code. |
platyPS | Used to generate Markdown documentation from PowerShell code. |
It also makes the following environment variables available to the runner:
Variable | Description |
---|---|
GITHUB_REPOSITORY_NAME | Contains the name of the repository, used to automatically act as the name of the module. |
The action can be configured using the following settings:
Name | Description | Default | Required |
---|---|---|---|
Version | The version of the Utilities module to install. | '' (latest) | false |
Prerelease | Whether to install prerelease versions of the Utilities module. | false | false |
Shell | The shell to use for running the tests. | pwsh | false |
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.
name: Process-PSModule
on: [push]
jobs:
Process-PSModule:
name: Process module
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Initialize environment
uses: PSModule/Initialize-PSModule@main
The action does not require any permissions.
The action is compatible with the following configurations:
OS | Shell |
---|---|
windows-latest | pwsh |
windows-latest | powershell |
macos-latest | pwsh |
ubuntu-latest | pwsh |