-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.73 KB
/
add_owner_to_app_registration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: add-owners-to-app-registrations-in-terraform
on:
workflow_dispatch:
inputs:
app_registration_name:
type: string
description: "Azure App registration name"
required: true
app_registration_owner:
type: string
description: "Azure App registration owners name. Provide as comma separated in case of multiple owners"
required: true
run-name: Adding owners to ${{ inputs.app_registration_name }}
jobs:
add-owners-to-app-registrations-in-terraform:
runs-on: ubuntu-latest
env:
ARM_CLIENT_ID: ${{ secrets.OWNER_SP_APP_ID }}
ARM_CLIENT_SECRET: ${{ secrets.OWNER_SP_APP_SECRET }}
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Listing files
run: ls -la
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.6.0"
- name: Terraform Init
run: terraform init
- name: Terraform Plan
run: terraform plan -var="app_registration_name=${{ inputs.app_registration_name }}" -var="app_registration_owner=${{ inputs.app_registration_owner }}" -out "plan.out"
- name: Terraform show
run: terraform show "plan.out"
- name: Terraform Apply
run: |
ls -la
terraform apply --auto-approve "plan.out"
- name: Owners added for App registration
run:
echo "App registration owners - ${{ inputs.app_registration_owners }}"
# Add more steps for applying the Terraform plan
- name: Process Completed
run: echo "Completed...."