Skip to content

Commit

Permalink
Merge pull request #146 from bouvet/misc/env-cleanup
Browse files Browse the repository at this point in the history
Added yaml workflow for deleting pr env after closed pr
  • Loading branch information
Trulsmatias authored Jan 31, 2025
2 parents fe46954 + 5376f96 commit 2c972d0
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/on-closed-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Remove Review Resources

on:
pull_request:
types: [closed]
branches: [main]
paths-ignore:
- README.md
- docs/
workflow_dispatch:
inputs:
pr:
description: 'Pull request number'
required: true
type: number

env:
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

jobs:
remove:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
name: 🗑️ Remove

steps:
- name: Azure Login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Remove review resources
run: |
dotnet tool install --global azure-resources-cleaner && \
azrc \
--pr ${{ inputs.pr || github.event.pull_request.number }} \
--subscription ${{ env.AZURE_SUBSCRIPTION_ID }}

0 comments on commit 2c972d0

Please sign in to comment.