Skip to content

Commit b305ae4

Browse files
🩹 [Add]: Implement artifact upload step and set GitHub output for module name in action workflow
1 parent 6015376 commit b305ae4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ runs:
3434
steps:
3535
- name: Run Build-PSModule
3636
uses: PSModule/GitHub-Script@v1
37+
id: build
3738
env:
3839
PSMODULE_BUILD_PSMODULE_INPUT_Name: ${{ inputs.Name }}
3940
PSMODULE_BUILD_PSMODULE_INPUT_Path: ${{ inputs.Path }}
@@ -45,3 +46,11 @@ runs:
4546
Script: |
4647
# Build-PSModule
4748
${{ github.action_path }}/scripts/main.ps1
49+
50+
- name: Upload module artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: module
54+
path: outputs/module/${{ fromJson(steps.build.outputs.result).ModuleName }}
55+
if-no-files-found: error
56+
retention-days: 1

‎scripts/main.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ LogGroup 'Loading inputs' {
2222
$env:PSMODULE_BUILD_PSMODULE_INPUT_Name
2323
}
2424
Write-Host "Module name: [$moduleName]"
25+
Set-GitHubOutput -Name ModuleName -Value $moduleName
2526

2627
$sourceFolderPath = Join-Path -Path $env:PSMODULE_BUILD_PSMODULE_INPUT_Path -ChildPath 'src'
2728
if (-not (Test-Path -Path $sourceFolderPath)) {

0 commit comments

Comments
 (0)