keyvault management using python #23
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: keyvault management using python | |
on: | |
workflow_dispatch: | |
inputs: | |
keyvault_name: | |
required: true | |
type: string | |
description: 'key vault name' | |
default: 'architects-keyvault' | |
operation: | |
description: 'get / set / list / delete / list_deleted_secrets / recover actions' | |
required: true | |
type: choice | |
options: | |
- get | |
- set | |
- list | |
- delete | |
- list_deleted_secrets | |
- recover | |
secret_name: | |
description: 'secret name' | |
default: '' | |
type: string | |
secret_value: | |
description: 'secret value' | |
type: string | |
default: '' | |
content: | |
description: 'content to add in secret metadata. if more than a word enclose in quotes' | |
type: string | |
default: '' | |
jobs: | |
keyvault_management: | |
runs-on: ubuntu-latest | |
env: | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Debug | |
run: | | |
echo "Secret Value: ${{ github.event.inputs.secret_value }}" | |
- name: set up python | |
uses: actions/setup-python@v2 | |
- name: package installations | |
run: | | |
pip install pipenv | |
pipenv install | |
pipenv graph | |
- name: run python program | |
run: | | |
pipenv run python3 kv_mgmt.py --keyvault_name ${{ github.event.inputs.keyvault_name }} \ | |
--operation ${{ github.event.inputs.operation }} \ | |
--secret_name ${{ github.event.inputs.secret_name }} \ | |
--secret_value ${{ github.event.inputs.secret_value }} \ | |
--content ${{ github.event.inputs.content }} | |
- name: job completed | |
run: echo "Job is completed" | |