PowerShell comments changes the script
This works:
- ps: >-
$ErrorActionPreference = "Stop";
./versionize.ps1 | %{ Update-AppveyorBuild -Version $_ };
$env:REPO_TAG_DESCRIPTION = (git tag -l --format='%(contents)' $env:APPVEYOR_REPO_TAG_NAME | Where-Object {$_}) -join "<br />";
Write-Host $env:REPO_TAG_DESCRIPTION;
This does not:
- ps: >-
$ErrorActionPreference = "Stop";
./versionize.ps1 | %{ Update-AppveyorBuild -Version $_ };
# Environment variables are truncated to the first line in appveyor (see https://github.com/appveyor/ci/issues/1688)
# so we join these together as html - and it finally works. We take the message from the tag and use as release message.
$env:REPO_TAG_DESCRIPTION = (git tag -l --format='%(contents)' $env:APPVEYOR_REPO_TAG_NAME | Where-Object {$_}) -join "<br />";
Write-Host $env:REPO_TAG_DESCRIPTION;
In the last script the environment variable is not set.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 15 Jul, 2022 03:08 PM
Yep, because
ps: >-
joins everything into a single line if there are no gaps between them. You should either put an empty line between last four lines:or use
ps: |
instead:otherwise, with
ps: >-
the last block becomes:basically a single comment.
Let me know if you have any questions.
Feodor Fitsner closed this discussion on 14 Sep, 2022 09:02 PM.