Set-ActionOutput not setting any output
MolotovCherry opened this issue · 3 comments
Hi,
The Set-ActionOutput
cmdlet seems to not be working for me at all. I have this workflow, and when it gets to the next step the output isn't even there.
name: Test
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set output
id: test
uses: Amadevus/pwsh-script@v2
with:
script: |
Set-ActionOutput testout igottest
- name: Run a multi-line script
run: |
echo "${{ steps.test.outputs.testout }}"
Thanks for the github action by the way, it's really cool to be able to have all these integrations from within powershell 😄
For now, just using the run command to run the script and manually outputting commands works for me.
Write-Host "::set-output name=test::igottest3"
This'll work as a sufficient workaround for me I guess
function Set-OutputVariable {
param(
[string]$Name,
[string]$Value
)
Write-Host "::set-output name=$Name::$Value"
}
Set-OutputVariable test value
Hi @cherryleafroad. Sadly, as noted (https://github.com/Amadevus/pwsh-script#notes), that specific command doesn't work due to this action being a Composite Action (https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-actions) :(
Most of this action's value is in simplicity of using the $context
s as PowerShell variables instead of workflow expressions, providing all workflow commands as cmdlets (except that Set-ActionOutput, obviously) and saving output as serialized json.