Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Workflow to test login #1314

Closed
wants to merge 10 commits into from
Closed
55 changes: 55 additions & 0 deletions .github/workflows/jboll-test-login.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Jboll testing
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- '.github/workflows/jboll-test-login.yml'
types:
- opened
- synchronize
- reopened
- closed
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
test_login:
name: 'Testing login'
permissions:
id-token: 'write'
contents: 'read'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1

- name: "install azure-cli"
uses: "Azure/ARO-HCP@main"

- name: 'set branch client id'
if: github.event_name != 'workflow_dispatch'
shell: bash
run: |
echo "AZURE_CLIENT_ID=${{ secrets.AZURE_CLIENT_ID }}" >> "$GITHUB_ENV"

- name: 'set workflow client id'
if: github.event_name == 'workflow_dispatch'
shell: bash
run: |
echo "AZURE_CLIENT_ID=${{ secrets.JBOLL_AZURE_CLIENT_ID }}" >> "$GITHUB_ENV"

- name: 'Az CLI login branch'
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}