Skip to content

Commit ee0fe22

Browse files
🩹 [Patch]: Code cleanup (#20)
## Description - `dependabot` config cleanup - Add test steps to check that custom steps can be run after init. - Add parameters (`Version` and `Prerelease`) to be able to control the version of GitHub module that is installed + log level with `Verbose` and `Debug`. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 1262ae1 commit ee0fe22

File tree

4 files changed

+47
-21
lines changed

4 files changed

+47
-21
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ updates:
99
directory: / # Location of package manifests
1010
schedule:
1111
interval: weekly
12-
- package-ecosystem: nuget # See documentation for possible values
13-
directory: / # Location of package manifests
14-
schedule:
15-
interval: weekly

.github/workflows/Action-Test.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
shell: [pwsh]
1918
os: [ubuntu-latest, macos-latest, windows-latest]
2019
name: Action-Test - [Basic] - [${{ matrix.os }}]
2120
runs-on: ${{ matrix.os }}
@@ -25,3 +24,18 @@ jobs:
2524

2625
- name: Action-Test
2726
uses: ./
27+
28+
- name: Run GitHub-script
29+
uses: PSModule/GitHub-script@v1
30+
with:
31+
Script: |
32+
LogGroup "Run custom script" {
33+
Write-Host "Hello, World!"
34+
}
35+
36+
- name: Run custom script
37+
shell: pwsh
38+
run: |
39+
LogGroup "Run custom script" {
40+
Write-Host "Hello, World!"
41+
}

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,24 @@ The Initialize-PSModule action will prepare the runner for the PSModule framewor
2222

2323
| Module | Description |
2424
| --- | --- |
25-
| Utilities | Used by all actions, contains common function and classes such as logging and grouping. |
25+
| GitHub | Used to interact with the GitHub API and GitHub Action workflow commands. |
26+
| PSScriptAnalyzer | Used to lint and format PowerShell code. |
2627
| PSSemVer | Used to create an object for the semantic version numbers. Has functionality to compare, and bump versions. |
27-
| powershell-yaml | Used to parse and serialize YAML files, typically for reading configuration files. |
2828
| Pester | Used for testing PowerShell code. |
29-
| PSScriptAnalyzer | Used to lint and format PowerShell code. |
29+
| Utilities | Used by all actions, contains common function and classes. |
3030
| platyPS | Used to generate Markdown documentation from PowerShell code. |
31-
32-
It also makes the following environment variables available to the runner:
33-
34-
| Variable | Description |
35-
| --- | --- |
36-
| GITHUB_REPOSITORY_NAME | Contains the name of the repository, used to automatically act as the name of the module. |
31+
| powershell-yaml | Used to parse and serialize YAML files, typically for reading configuration files. |
3732

3833
## Usage
3934

40-
The action can be configured using the following settings:
35+
### Inputs
4136

42-
| Name | Description | Default | Required |
43-
| --- | --- | --- | --- |
44-
| Version | The version of the Utilities module to install. | '' (latest) | false |
45-
| Prerelease | Whether to install prerelease versions of the Utilities module. | false | false |
46-
| Shell | The shell to use for running the tests. | pwsh | false |
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 resource to be returned. | false | |
42+
| `Prerelease` | Allow prerelease versions if available. | false | `'false'` |
4743

4844
## Example
4945

@@ -77,6 +73,5 @@ The action is compatible with the following configurations:
7773
| OS | Shell |
7874
| --- | --- |
7975
| windows-latest | pwsh |
80-
| windows-latest | powershell |
8176
| macos-latest | pwsh |
8277
| ubuntu-latest | pwsh |

action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,33 @@ branding:
55
icon: loader
66
color: gray-dark
77

8+
inputs:
9+
Debug:
10+
description: Enable debug output.
11+
required: false
12+
default: 'false'
13+
Verbose:
14+
description: Enable verbose output.
15+
required: false
16+
default: 'false'
17+
Version:
18+
description: Specifies the version of the resource to be returned.
19+
required: false
20+
Prerelease:
21+
description: Allow prerelease versions if available.
22+
required: false
23+
default: 'false'
24+
825
runs:
926
using: composite
1027
steps:
1128
- name: Initialize-PSModule
1229
uses: PSModule/GitHub-Script@v1
1330
with:
31+
Debug: ${{ inputs.Debug }}
32+
Prerelease: ${{ inputs.Prerelease }}
33+
Verbose: ${{ inputs.Verbose }}
34+
Version: ${{ inputs.Version }}
1435
Script: |
1536
# Initialize-PSModule
1637
. "${{ github.action_path }}\scripts\main.ps1" -Verbose

0 commit comments

Comments
 (0)