From 9cc4676d744569f8755c6226ab85f19c537763a4 Mon Sep 17 00:00:00 2001 From: elzik <23397871+elzik@users.noreply.github.com> Date: Mon, 30 Oct 2023 20:50:27 +0000 Subject: [PATCH] Use PowerShell for checking for PR --- .github/workflows/continuous-delivery.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index f9ccd25..e09fd45 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -40,18 +40,18 @@ jobs: id: prcheck env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash run: | - prs=$(gh pr list \ - --repo "$GITHUB_REPOSITORY" \ - --json baseRefName,headRefName \ - --jq ' - map(select(.baseRefName == "main" and .headRefName == "${{ github.ref_name }}")) - | length - ') - if ((prs > 0)); then - echo "pull_request_exists=true" >> "$GITHUB_OUTPUT" - fi + $prs = $(gh pr list ` + --repo "$env:GITHUB_REPOSITORY" ` + --json baseRefName,headRefName ` + --jq ' + map(select(.baseRefName == "main" and .headRefName == $env:github_ref_name)) + | length + ') + if ($prs -gt 0) { + Add-Content -Path $env:GITHUB_OUTPUT -Value "pull_request_exists=true" + } + shell: pwsh - name: Tag With SemVer id: tag if: github.ref_name == 'main'