Check Azure Permissions #6
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: Check Azure Permissions | |
on: | |
workflow_dispatch: | |
inputs: | |
ACR_NAME: | |
description: 'ACR Name' | |
required: true | |
RESOURCE_GROUP: | |
description: 'Resource Group' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ACR_NAME: ${{ github.event.inputs.ACR_NAME }} | |
RESOURCE_GROUP: ${{ github.event.inputs.RESOURCE_GROUP }} | |
steps: | |
- name: Checkout Repository Content | |
uses: actions/checkout@v4 | |
- name: Azure Login | |
uses: azure/login@v2 | |
with: | |
creds: | | |
{ | |
"clientId": "${{ secrets.AZURE_CLIENT_ID }}", | |
"clientSecret": "${{ secrets.AZURE_CLIENT_SECRET }}", | |
"subscriptionId": "${{ secrets.AZURE_SUBSCRIPTION_ID }}", | |
"tenantId": "${{ secrets.AZURE_TENANT_ID }}" | |
} | |
- name: Check the role | |
env: | |
APP_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
RESOURCE_GROUP: ${{ env.RESOURCE_GROUP }} | |
ACR_NAME: ${{ env.ACR_NAME }} | |
run: | | |
az role assignment list --assignee $APP_ID --scope /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.ContainerRegistry/registries/$ACR_NAME | |