Skip to content

Commit 46ccd1a

Browse files
authored
Replace softprops/action-gh-release with gh CLI (reactivemarbles#1092)
softprops/action-gh-release is not on the repository's allowed-actions list, causing release.yml to fail with startup_failure on every push to main and release/*.x. The pre-installed gh CLI on windows runners produces an equivalent GitHub Release without requiring a third-party action.
1 parent e6055c5 commit 46ccd1a

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,16 @@ jobs:
131131
id: changelog
132132

133133
- name: Create GitHub Release
134-
uses: softprops/action-gh-release@v2.6.2
135-
with:
136-
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
137-
name: ${{ steps.nbgv.outputs.SemVer2 }}
138-
prerelease: ${{ steps.nbgv.outputs.PrereleaseVersion != '' }}
139-
body: |
140-
${{ steps.changelog.outputs.commitLog }}
134+
env:
135+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
TAG: ${{ steps.nbgv.outputs.SemVer2 }}
137+
IS_PRERELEASE: ${{ steps.nbgv.outputs.PrereleaseVersion != '' }}
138+
BODY: ${{ steps.changelog.outputs.commitLog }}
139+
shell: pwsh
140+
run: |
141+
$ErrorActionPreference = 'Stop'
142+
$notesPath = Join-Path $env:RUNNER_TEMP 'release-notes.md'
143+
Set-Content -Path $notesPath -Value $env:BODY -Encoding utf8 -NoNewline
144+
$cmd = @('release', 'create', $env:TAG, '--title', $env:TAG, '--notes-file', $notesPath, '--target', $env:GITHUB_SHA)
145+
if ($env:IS_PRERELEASE -eq 'true') { $cmd += '--prerelease' }
146+
gh @cmd

0 commit comments

Comments
 (0)