We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f654ea6 commit ea293a9Copy full SHA for ea293a9
.github/actions/ps-release/action.yml
@@ -20,12 +20,16 @@ runs:
20
GITHUB_TOKEN: ${{ github.token }}
21
run: |
22
git fetch --tags
23
- $previousTag = (git tag --sort=-v:refname)[0]
+ $tags = @(git tag --sort=-v:refname)
24
+ $previousTag = if ($tags.Count -gt 0) { $tags[0] } else { $null }
25
$uri = "https://api.github.com/repos/${{ github.repository }}/releases/generate-notes"
26
$body = @{
27
tag_name = "v${{ inputs.release-version }}"
28
target_commitish = "main"
- previous_tag_name = $previousTag
29
+ }
30
+ # Only include previous_tag_name if a previous tag exists
31
+ if ($previousTag) {
32
+ $body['previous_tag_name'] = $previousTag
33
}
34
$requestParams = @{
35
Method = 'Post'
0 commit comments