From e9a2085bcf668ffc2ad91b062f54c7a81cdc035c Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 10:56:20 +0530 Subject: [PATCH 1/7] Create azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/azure-login-pr-check.yml diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml new file mode 100644 index 00000000..5c32318b --- /dev/null +++ b/.github/workflows/azure-login-pr-check.yml @@ -0,0 +1,70 @@ +name: pr-check + +on: + pull_request_target: + branches: + - master + - 'releases/*' + - users/balaga-gayatri/test-automation +jobs: + az-login-test: + environment: Automation test + runs-on: windows-latest + steps: + - name: Checkout from PR branch + uses: actions/checkout@v2 + + # Using 12.x version as an example + - name: Set Node.js 12.x for GitHub Action + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: installing node_modules + run: npm install + + - name: Build GitHub Action + run: npm run build + + - name: 'Az CLI login with subscription' + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - run: | + az account show + # az webapp list + + - 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" + + From 84ba7c37ac8f1bbc2731effee3a9a4d55d84d579 Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 12:48:37 +0530 Subject: [PATCH 2/7] Update azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml index 5c32318b..8f86decd 100644 --- a/.github/workflows/azure-login-pr-check.yml +++ b/.github/workflows/azure-login-pr-check.yml @@ -27,7 +27,7 @@ jobs: run: npm run build - name: 'Az CLI login with subscription' - uses: azure/login@v1 + uses: ./ with: creds: ${{ secrets.AZURE_CREDENTIALS }} @@ -36,7 +36,7 @@ jobs: # az webapp list - name: 'Az CLI login without subscription' - uses: azure/login@v1 + uses: ./ with: creds: ${{ secrets.AZURE_CREDENTIALS_NO_SUB }} allow-no-subscriptions: true @@ -45,7 +45,7 @@ jobs: az account show - name: 'Azure PowerShell login with subscription' - uses: azure/login@v1 + uses: ./ with: creds: ${{ secrets.AZURE_CREDENTIALS }} enable-AzPSSession: true @@ -56,7 +56,7 @@ jobs: azPSVersion: "latest" - name: 'Azure PowerShell login without subscription' - uses: azure/login@v1 + uses: ./ with: creds: ${{secrets.AZURE_CREDENTIALS_NO_SUB}} enable-AzPSSession: true From 41b2820dc1aa13373549a1d2e4b11c57f96d1cd6 Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 12:56:31 +0530 Subject: [PATCH 3/7] Update azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml index 8f86decd..c9621596 100644 --- a/.github/workflows/azure-login-pr-check.yml +++ b/.github/workflows/azure-login-pr-check.yml @@ -12,7 +12,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout from PR branch - uses: actions/checkout@v2 + uses: actions/checkout@v2 # Using 12.x version as an example - name: Set Node.js 12.x for GitHub Action @@ -39,7 +39,7 @@ jobs: uses: ./ with: creds: ${{ secrets.AZURE_CREDENTIALS_NO_SUB }} - allow-no-subscriptions: true + allow-no-subscriptions: true - run: | az account show @@ -62,9 +62,9 @@ jobs: enable-AzPSSession: true allow-no-subscriptions: true - - uses: azure/powershell@v1 - with: - inlineScript: "Get-AzContext" - azPSVersion: "latest" + - uses: azure/powershell@v1 + with: + inlineScript: "Get-AzContext" + azPSVersion: "latest" From 7d999374ef7e4d43d6e21065d4d4886ad4ab81a1 Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 13:28:22 +0530 Subject: [PATCH 4/7] Update azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml index c9621596..e5496a44 100644 --- a/.github/workflows/azure-login-pr-check.yml +++ b/.github/workflows/azure-login-pr-check.yml @@ -1,7 +1,7 @@ name: pr-check on: - pull_request_target: + pull_request: branches: - master - 'releases/*' From 4e20baabbad212a5fe3cd8f0872c4c4b125292b9 Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 13:34:00 +0530 Subject: [PATCH 5/7] Update azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml index e5496a44..efc9d409 100644 --- a/.github/workflows/azure-login-pr-check.yml +++ b/.github/workflows/azure-login-pr-check.yml @@ -1,7 +1,7 @@ name: pr-check on: - pull_request: + pull_request_target: branches: - master - 'releases/*' @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout from PR branch uses: actions/checkout@v2 + with: + ref: ${{ github.event.client_payload.frombranch }} # Using 12.x version as an example - name: Set Node.js 12.x for GitHub Action From 24f48797ce2e3c0b50e382f2dc3467053e9781c1 Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 13:34:57 +0530 Subject: [PATCH 6/7] Update azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml index efc9d409..8abd2804 100644 --- a/.github/workflows/azure-login-pr-check.yml +++ b/.github/workflows/azure-login-pr-check.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout from PR branch uses: actions/checkout@v2 with: - ref: ${{ github.event.client_payload.frombranch }} + ref: ${{ github.event.pull_request.head.ref }} # Using 12.x version as an example - name: Set Node.js 12.x for GitHub Action From fd46a15100ce8330f045b95798cd0c405e703ed5 Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 13:43:39 +0530 Subject: [PATCH 7/7] Update azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml index 8abd2804..1a69c8e2 100644 --- a/.github/workflows/azure-login-pr-check.yml +++ b/.github/workflows/azure-login-pr-check.yml @@ -5,7 +5,6 @@ on: branches: - master - 'releases/*' - - users/balaga-gayatri/test-automation jobs: az-login-test: environment: Automation test