azure-decommision-unsed-resource-groups-with-temporary-tag-as-true #155
This file contains hidden or 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: azure-decommision-unsed-resource-groups-with-temporary-tag-as-true | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # This means every day at 00:00 UTC | |
| workflow_dispatch: | |
| inputs: | |
| subscription_name: | |
| required: true | |
| type: string | |
| default: "TECH-ARCHITECTS-NONPROD" | |
| description: "The azure subscription name." | |
| run-name: azure-decommision-unsed-resource-groups-with-temporary-tag-as-true | |
| jobs: | |
| azure-decommision-unsed-resource-groups-with-temporary-tag-as-true: | |
| 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 }} | |
| subscription_name: "TECH-ARCHITECTS-NONPROD" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: set up python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: package installations | |
| run: | | |
| pip install poetry | |
| poetry install -v --no-root --no-interaction | |
| - name: run python program | |
| run: | | |
| poetry run python3 terraforminator.py --subscription_name ${{ env.subscription_name }} | |
| - name: program execution completed | |
| run: echo "program execution completed" |