Преглед изворни кода

fix: Update release version naming in GitHub API call

Corrected the API call to fetch release details by properly adding 'v' before the RELEASE_VERSION in the request. Moreover, added a check for the name attribute of the returned URL instead of the URL string itself, ensuring the release creation calls function properly when no previous release exists.
DerSkythe пре 2 година
родитељ
комит
b6d3225b95
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      .github/workflows/build-with-firmwware.yml

+ 2 - 2
.github/workflows/build-with-firmwware.yml

@@ -244,8 +244,8 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.FLIPPER_TOKEN }}
         run: |
-          $url = (gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.REPOSITORY }}/releases/tags/${{ env.RELEASE_VERSION }}) | ConvertFrom-Json -AsHashtable
-          if ( [string]::IsNullOrWhitespace($url) ) {
+          $url = (gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.REPOSITORY }}/releases/tags/v${{ env.RELEASE_VERSION }}) | ConvertFrom-Json -AsHashtable
+          if ( [string]::IsNullOrWhitespace($url.name) ) {
             gh release create v${{ env.RELEASE_VERSION }} --generate-notes --draft -R ${{ env.REPO_SELF }}  
           }          
           gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' '${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}