Skip to content

Commit

Permalink
Merge pull request #873 from 0xPolygonID/update_delete_helm_branch
Browse files Browse the repository at this point in the history
Update delete helm branch
  • Loading branch information
martinsaporiti authored Dec 23, 2024
2 parents ef00fd9 + 66e03f2 commit 9380904
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/delete_testing_env.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Delete Helm Release

on: [delete]
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to target'
required: true

env:
BRANCH_NAME: ${{ github.event.ref }}
BRANCH_NAME: ${{ github.event.inputs.branch }}

jobs:
delete:
Expand All @@ -24,14 +29,14 @@ jobs:
echo "Extracted URL: $url"
echo "::set-output name=url::$url"
- name: Cambiar contexto de kubectl
- name: change k3s context
run: |
kubectl config use-context k3s
- name: Verificar conexión al clúster
- name: check if the cluster exists
run: kubectl cluster-info

- name: Check if helm chart exists
- name: check if helm chart exists
id: helm_check
run: |
result=$(helm list --namespace "${{ steps.extract-url.outputs.url }}" -q | grep "^${{ steps.extract-url.outputs.url }}$" || echo 'not_found')
Expand All @@ -48,7 +53,7 @@ jobs:
overrule_existing_kubeconfig: "true"
if: steps.helm_check.outputs.result != 'not_found'

- name: "Delete namespace"
- name: "delete namespace"
run: |
kubectl delete namespace ${{ env.BRANCH_NAME }}
if: steps.helm_check.outputs.result != 'not_found'

0 comments on commit 9380904

Please sign in to comment.