Skip to content

Commit

Permalink
.github: do a functional check for az login
Browse files Browse the repository at this point in the history
Instead of checking for the "cause" of login failure, check for the
symptom, so we don't get false positives.

Signed-off-by: Steve Kuznetsov <stekuznetsov@microsoft.com>
  • Loading branch information
stevekuznetsov committed Nov 22, 2024
1 parent 6273bb8 commit d38939f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/aro-hcp-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,18 @@
name: 'Ensure PR is submitted from Azure/ARO-HCP'
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
id-token: 'write'
contents: 'read'
steps:
- name: 'Az CLI login - will fail if PR is submitted from a fork of the repo'
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Fail if PR submitted from fork
if: ${{ github.event.pull_request.head.repo.full_name != 'Azure/ARO-HCP' }}
if: failure()
run: core.setFailed('Expected source repository to be Azure/ARO-HCP, not ${{ github.event.pull_request.head.repo.full_name }}, re-create PR as a branch of Azure/ARO-HCP')

deploy_global_rg:
Expand Down

0 comments on commit d38939f

Please sign in to comment.