Skip to content

Commit dbad071

Browse files
Restore Name as optional input; defaults to repository name
1 parent 3b26296 commit dbad071

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/Action-Test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- name: Action-Test
3131
uses: ./
3232
with:
33+
Name: PSModuleTest
3334
Version: 1.0.0
3435
ArtifactName: PSModuleTestDefault
3536
WorkingDirectory: tests/srcTestRepo
@@ -46,6 +47,7 @@ jobs:
4647
- name: Action-Test
4748
uses: ./
4849
with:
50+
Name: PSModuleTest
4951
Version: 1.0.0
5052
ArtifactName: PSModuleTestMinimal
5153
WorkingDirectory: tests/srcMinimalTestRepo
@@ -62,6 +64,7 @@ jobs:
6264
- name: Action-Test
6365
uses: ./
6466
with:
67+
Name: PSModuleTest
6568
Version: 1.0.0
6669
ArtifactName: PSModuleTestWithManifest
6770
WorkingDirectory: tests/srcWithManifestTestRepo

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ description: Build a PowerShell module to the PowerShell Gallery.
33
author: PSModule
44

55
inputs:
6+
Name:
7+
description: Name of the module to build. Defaults to the repository name.
8+
required: false
69
OutputFolder:
710
description: Path to the folder where the built module is outputted.
811
required: false
@@ -33,6 +36,7 @@ runs:
3336
id: build
3437
working-directory: ${{ inputs.WorkingDirectory }}
3538
env:
39+
PSMODULE_BUILD_PSMODULE_INPUT_Name: ${{ inputs.Name }}
3640
PSMODULE_BUILD_PSMODULE_INPUT_OutputFolder: ${{ inputs.OutputFolder }}
3741
PSMODULE_BUILD_PSMODULE_INPUT_Version: ${{ inputs.Version }}
3842
PSMODULE_BUILD_PSMODULE_INPUT_Prerelease: ${{ inputs.Prerelease }}

src/main.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ Set-GitHubLogGroup "Loading helper scripts from [$path]" {
1616
$env:GITHUB_REPOSITORY_NAME = $env:GITHUB_REPOSITORY -replace '.+/'
1717

1818
Set-GitHubLogGroup 'Loading inputs' {
19-
$moduleName = $env:GITHUB_REPOSITORY_NAME
19+
$moduleName = if ([string]::IsNullOrEmpty($env:PSMODULE_BUILD_PSMODULE_INPUT_Name)) {
20+
$env:GITHUB_REPOSITORY_NAME
21+
} else {
22+
$env:PSMODULE_BUILD_PSMODULE_INPUT_Name
23+
}
2024
$moduleVersion = $env:PSMODULE_BUILD_PSMODULE_INPUT_Version
2125
$modulePrerelease = $env:PSMODULE_BUILD_PSMODULE_INPUT_Prerelease
2226
$sourceFolderPath = Resolve-Path -Path 'src' | Select-Object -ExpandProperty Path

0 commit comments

Comments
 (0)