From b6f7d6616ab7cb3d5beddec574b3b14188d53569 Mon Sep 17 00:00:00 2001 From: Nuru Date: Mon, 28 Jun 2021 22:03:22 -0700 Subject: [PATCH] Allow manual kickoff of aws-nuke (#119) --- .github/workflows/aws-nuke.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/aws-nuke.yml b/.github/workflows/aws-nuke.yml index 34920b4..cdfeebb 100644 --- a/.github/workflows/aws-nuke.yml +++ b/.github/workflows/aws-nuke.yml @@ -3,20 +3,26 @@ name: 'aws-nuke' on: # Enable manual runs workflow_dispatch: - + inputs: + delete: + description: 'Set to "true" to actually delete stuff' + required: true + default: 'false' + # Enable pull request for testing pull_request: types: [opened, synchronize, reopened] # Nuke testing account nightly schedule: - - cron: '0 0 * * *' + # Run at noon UTC, 4 or 5am PT + - cron: '0 12 * * *' jobs: # Run aws-nuke simulation (don't actually delete anything) dry-run: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' + if: github.event_name == 'pull_request' || ( github.event_name == 'workflow_dispatch' && github.event.inputs.delete != 'true' ) steps: - name: checkout uses: actions/checkout@v2 @@ -32,7 +38,7 @@ jobs: # Run aws-nuke "for reals" (delete everything) no-dry-run: runs-on: ubuntu-latest - if: github.event_name == 'schedule' + if: github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && github.event.inputs.delete == 'true' ) steps: - name: checkout uses: actions/checkout@v2