Skip to content

🌟 [Major]: Introducing Install-PSModuleHelpers #2

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

Merged
merged 24 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
95b8b04
Add functions to convert version specifications and resolve module de…
MariusStorhaug Mar 5, 2025
72a8b14
Add Import-PSModule function to import build PS modules
MariusStorhaug Mar 5, 2025
1522f31
Refactor main.ps1 to streamline module import process and remove obso…
MariusStorhaug Mar 5, 2025
b4b49e2
Remove obsolete helper functions for module import and version specif…
MariusStorhaug Mar 5, 2025
7d2c33c
Rename action and update workflow to remove unnecessary inputs
MariusStorhaug Mar 5, 2025
e52ba4e
Fix error handling when removing obsolete Helpers module directory
MariusStorhaug Mar 5, 2025
d464c20
Add Helpers module manifest file with versioning
MariusStorhaug Mar 5, 2025
74ea471
Remove obsolete module requirements and refactor retry logic in Publi…
MariusStorhaug Mar 5, 2025
772d97f
Refactor Helpers module functions to improve parameter handling and s…
MariusStorhaug Mar 5, 2025
9b83e03
Suppress diagnostic warnings for variable scoping in Publish-PSModule…
MariusStorhaug Mar 5, 2025
d8a8e7c
Update jscpd configuration to ignore linters directory in duplicate c…
MariusStorhaug Mar 5, 2025
31c6a55
remove some functions
MariusStorhaug Mar 5, 2025
aca15d2
Add Install-PSModule function to facilitate module installation
MariusStorhaug Mar 5, 2025
10434f3
Rename parameter in Install-PSModule function for clarity and consist…
MariusStorhaug Mar 5, 2025
1a6e7a4
Add PassThru parameter to Install-PSModule function to return install…
MariusStorhaug Mar 5, 2025
1fd0df8
Remove mandatory requirement for PassThru parameter in Install-PSModu…
MariusStorhaug Mar 5, 2025
9cb456b
Add ShowInfo parameter to Install-PSModuleHelpers for configurable ou…
MariusStorhaug Mar 6, 2025
3caad7f
Update default WorkingDirectory in action.yml to use relative path
MariusStorhaug Mar 6, 2025
978058d
Update log message in main.ps1 to clarify module import process
MariusStorhaug Mar 7, 2025
a097f53
Refactor action.yml to simplify input parameters and update main.ps1 …
MariusStorhaug Mar 10, 2025
e165fcd
Enhance logging in Install-PSModule function by replacing LogGroup wi…
MariusStorhaug Mar 10, 2025
94abace
Add logging for dependency resolution in Install-PSModule function
MariusStorhaug Mar 10, 2025
fde65d9
Add verification step for Helpers module installation in Action-Test …
MariusStorhaug Apr 17, 2025
58a824d
Refactor README.md to consolidate the "What this action does" section…
MariusStorhaug Apr 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"consoleFull"
],
"ignore": [
"**/tests/**"
"**/tests/**",
"**/linters/**"
],
"absolute": true
}
12 changes: 9 additions & 3 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:

- name: Action-Test
uses: ./
with:
working-directory: ./tests
subject: PSModule

- name: Verify Helpers Module Installation
shell: pwsh
run: |
if (Get-Module -Name Helpers -ListAvailable) {
Write-Host "Helpers module successfully installed."
} else {
throw "Helpers module not found!"
}
60 changes: 53 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,63 @@
# Template-Action
# Install-PSModuleHelpers

A template repository for GitHub Actions
A GitHub Action to install and configure the PSModule helper modules for use in continuous integration and delivery (CI/CD) workflows. This action is
a critical component for setting up a standardized PowerShell environment across repositories using the PSModule framework.

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.

## What this action does

- Removes any existing instances of the `Helpers` module from the PowerShell session.
- Copies the latest version of the `Helpers` module into the PowerShell module directory.
- Imports the `Helpers` module, ensuring it is available for subsequent steps.

This action helps maintain consistency and reliability across workflows that depend on the PSModule framework.

## Usage

### Inputs
```yaml
- name: Install PSModule Helpers
uses: PSModule/Install-PSModuleHelpers@v1
```

## Inputs

_No inputs required._

### Secrets
## Secrets

### Outputs
_No secrets required._

### Example
## Outputs

This action does not provide any outputs.

## Example

Here's a complete workflow example demonstrating how to use the Install-PSModuleHelpers action:

```yaml
Example here
name: CI

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install PSModule Helpers
uses: PSModule/Install-PSModuleHelpers@v1

- name: Run additional steps
shell: pwsh
run: |
# Example usage of imported Helpers module
Get-Command -Module Helpers
```
47 changes: 7 additions & 40 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,15 @@
name: {{ NAME }}
description: {{ DESCRIPTION }}
name: Install-PSModuleHelpers
description: Installs the PSModule helpers.
author: PSModule
branding:
icon: upload-cloud
color: white

inputs:
subject:
description: The subject to greet
required: false
default: World
Debug:
description: Enable debug output.
required: false
default: 'false'
Verbose:
description: Enable verbose output.
required: false
default: 'false'
Version:
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
required: false
Prerelease:
description: Allow prerelease versions if available.
required: false
default: 'false'
WorkingDirectory:
description: The working directory where the script will run from.
required: false
default: ${{ github.workspace }}

runs:
using: composite
steps:
- name: {{ NAME }}
uses: PSModule/GitHub-Script@v1
env:
{{ ORG }}_{{ NAME }}_INPUT_subject: ${{ inputs.subject }}
with:
Debug: ${{ inputs.Debug }}
Prerelease: ${{ inputs.Prerelease }}
Verbose: ${{ inputs.Verbose }}
Version: ${{ inputs.Version }}
WorkingDirectory: ${{ inputs.WorkingDirectory }}
Script: |
# {{ NAME }}
${{ github.action_path }}/scripts/main.ps1
- name: Install-PSModuleHelpers
shell: pwsh
run: |
# Install-PSModuleHelpers
${{ github.action_path }}/scripts/main.ps1
4 changes: 4 additions & 0 deletions scripts/Helpers/Helpers.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@{
RootModule = 'Helpers.psm1'
ModuleVersion = '999.0.0'
}
Loading
Loading