From 37e4e3fac9276ad13dc998d03f7bf0fdad577d19 Mon Sep 17 00:00:00 2001 From: Freddy Kristiansen Date: Wed, 27 Sep 2023 10:08:29 +0200 Subject: [PATCH] fix gh (#732) Co-authored-by: freddydk --- .github/workflows/Deploy.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Deploy.yaml b/.github/workflows/Deploy.yaml index 1372a0cf9..262028b59 100644 --- a/.github/workflows/Deploy.yaml +++ b/.github/workflows/Deploy.yaml @@ -35,11 +35,13 @@ jobs: - name: Validate Deployment if: github.repository_owner == 'microsoft' env: + GH_TOKEN: ${{ github.token }} branch: ${{ github.event.inputs.branch }} repository: ${{ github.repository }} runId: ${{ github.run_id }} run: | - if ($env:branch -match 'preview') { + $errorActionPreference = "Stop" + if ($env:branch -eq 'preview') { Write-Host "Deploying to preview branch. No validation required" } else { $approval = gh api /repos/$($env:repository)/actions/runs/$($env:runId)/approvals | ConvertFrom-Json