We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent faf493e commit 904e342Copy full SHA for 904e342
1 file changed
.github/workflows/terraform-infra-apply.yaml
@@ -55,4 +55,14 @@ jobs:
55
56
- name: Terraform Apply
57
run: terraform apply -auto-approve -var-file="terraform.tfvars"
58
- working-directory: terraform/environments/${{ steps.env.outputs.env_name }}
+ working-directory: terraform/environments/${{ steps.env.outputs.env_name }}
59
+ - name: Delete apply branch
60
+ if: startsWith(github.ref, 'refs/heads/apply/')
61
+ env:
62
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63
+ run: |
64
+ BRANCH_NAME="${GITHUB_REF#refs/heads/}"
65
+ echo "Deleting branch: $BRANCH_NAME"
66
+ gh api \
67
+ -X DELETE \
68
+ /repos/${{ github.repository }}/git/refs/heads/$BRANCH_NAME
0 commit comments