Просмотр исходного кода

fix: Update check for dynamic release tag in workflow

The build workflow for 'Subbrute' application was updated to use a dynamic check for the release tag in Github API call. This change enhances efficiency by reducing unnecessary API calls and mitigating potential issues if a specific release tag doesn't exist.
DerSkythe 2 лет назад
Родитель
Сommit
5d2297dafe
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      .github/workflows/build-with-firmwware.yml

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

@@ -195,7 +195,7 @@ jobs:
           $api = "X-GitHub-Api-Version: 2022-11-28"
           $api = "X-GitHub-Api-Version: 2022-11-28"
           #$url = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases/tags/v${{ env.RELEASE_VERSION }} >$null 2>&1) | ConvertFrom-Json -AsHashtable -ErrorAction SilentlyContinue
           #$url = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases/tags/v${{ env.RELEASE_VERSION }} >$null 2>&1) | ConvertFrom-Json -AsHashtable -ErrorAction SilentlyContinue
           $json = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases) | ConvertFrom-Json
           $json = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases) | ConvertFrom-Json
-          $tagExists = ($json.GetEnumerator() | Where-Object { $_.tag_name -eq 'v3.19.2' }) -ne $null
+          $tagExists = ($json.GetEnumerator() | Where-Object { $_.tag_name -eq 'v${{ env.RELEASE_VERSION }}' }) -ne $null
           if ( $tagExists -eq $true ) {
           if ( $tagExists -eq $true ) {
             $sha = (git rev-parse --verify HEAD)
             $sha = (git rev-parse --verify HEAD)
             gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish="$sha" -f name='v${{ env.RELEASE_VERSION }}' -F draft=true -F prerelease=false -F generate_release_notes=true
             gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish="$sha" -f name='v${{ env.RELEASE_VERSION }}' -F draft=true -F prerelease=false -F generate_release_notes=true