Add Workflow to test login #12
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: | |
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 }} |