Add Workflow to test login #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Jboll testing | |
env: | |
DEPLOY_ENV: dev | |
PERSIST: true | |
SKIP_CONFIRM: true | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
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' | |
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | |
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: 'Az CLI login branch' | |
if: github.event.pull_request.merged == true | |
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: 'Az CLI login workflow' | |
if: github.event_name == 'workflow_dispatch' | |
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 }} |