From 6cfc954aa27d897a508b003623c0ebd1bfd2079b Mon Sep 17 00:00:00 2001 From: Kanika Pasrija <58769601+kanika1894@users.noreply.github.com> Date: Wed, 23 Jun 2021 20:30:35 +0530 Subject: [PATCH] Create pr-test --- .github/workflows/pr-test | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/pr-test diff --git a/.github/workflows/pr-test b/.github/workflows/pr-test new file mode 100644 index 00000000..c3e07d7a --- /dev/null +++ b/.github/workflows/pr-test @@ -0,0 +1,60 @@ +name: pr-test + +on: + pull_request_target: + types: [labeled, opened] + branches: + - master + - 'releases/*' + +jobs: + deploy: + if: contains(github.event.pull_request.labels.*.name, 'safe to run test') + runs-on: windows-latest + steps: + - name: Checkout from PR branch + uses: actions/checkout@v2 + + - name: Building latest changes + run: | + npm install --prod + + - name: 'Az CLI login with subscription' + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - run: | + az account show + + - name: 'Az CLI login without subscription' + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS_NO_SUB }} + allow-no-subscriptions: true + + - run: | + az account show + + - name: 'Azure PowerShell login with subscription' + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + enable-AzPSSession: true + + - uses: azure/powershell@v1 + with: + inlineScript: "Get-AzContext" + azPSVersion: "latest" + + - name: 'Azure PowerShell login without subscription' + uses: azure/login@v1 + with: + creds: ${{secrets.AZURE_CREDENTIALS_NO_SUB}} + enable-AzPSSession: true + allow-no-subscriptions: true + + - uses: azure/powershell@v1 + with: + inlineScript: "Get-AzContext" + azPSVersion: "latest"