From 2d70445ef703be555851042090e7410cdcdb07b8 Mon Sep 17 00:00:00 2001 From: Loic Devulder Date: Fri, 18 Oct 2024 16:19:00 +0200 Subject: [PATCH] ci: no need to run clean-delete if we want to keep the runner Signed-off-by: Loic Devulder --- .github/workflows/master_e2e.yaml | 5 +---- .github/workflows/sub_clean-and-delete-runner.yaml | 11 ----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/master_e2e.yaml b/.github/workflows/master_e2e.yaml index b0444da12..7e1be31c7 100644 --- a/.github/workflows/master_e2e.yaml +++ b/.github/workflows/master_e2e.yaml @@ -268,15 +268,12 @@ jobs: clean-and-delete-runner: needs: [create-runner, e2e] - if: ${{ always() }} + if: ${{ always() && needs.create-runner.result == 'success' && inputs.destroy_runner == true }} uses: ./.github/workflows/sub_clean-and-delete-runner.yaml secrets: credentials: ${{ secrets.credentials }} with: - create_runner_result: ${{ needs.create-runner.result }} - destroy_runner: ${{ inputs.destroy_runner }} runner_hostname: ${{ needs.create-runner.outputs.runner_hostname }} - runner_label: ${{ needs.create-runner.outputs.runner_label }} zone: ${{ inputs.zone }} post-qase: diff --git a/.github/workflows/sub_clean-and-delete-runner.yaml b/.github/workflows/sub_clean-and-delete-runner.yaml index 85c4c6841..1507fba3a 100644 --- a/.github/workflows/sub_clean-and-delete-runner.yaml +++ b/.github/workflows/sub_clean-and-delete-runner.yaml @@ -5,19 +5,9 @@ on: workflow_call: # Variables to set when calling this reusable workflow inputs: - create_runner_result: - description: Status of the create-runner job - required: true - type: string - destroy_runner: - required: true - type: boolean runner_hostname: required: true type: string - runner_label: - required: true - type: string zone: required: true type: string @@ -43,7 +33,6 @@ jobs: uses: google-github-actions/setup-gcloud@v2 - name: Delete runner - if: ${{ inputs.create_runner_result == 'success' && inputs.destroy_runner == true }} run: | # Disable failure on first error, needed for the "delete" check set +e