branch-remove.yml 1.1 KB

12345678910111213141516171819202122
  1. name: "Infra: Feature Testing: Destroy env"
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. types: ['unlabeled', 'closed']
  6. jobs:
  7. remove:
  8. runs-on: ubuntu-latest
  9. if: ${{ (github.event.label.name == 'status/feature_testing' || github.event.label.name == 'status/feature_testing_public') || (github.event.action == 'closed' && (contains(github.event.pull_request.labels.*.name, 'status/feature_testing') || contains(github.event.pull_request.labels.*.name, 'status/feature_testing_public'))) }}
  10. steps:
  11. - uses: actions/checkout@v3
  12. - name: clone
  13. run: |
  14. git clone https://infra-tech:${{ secrets.INFRA_USER_ACCESS_TOKEN }}@github.com/provectus/kafka-ui-infra.git --branch envs
  15. - name: remove env
  16. run: |
  17. cd kafka-ui-infra/aws-infrastructure4eks/argocd/scripts
  18. ./delete-env.sh pr${{ github.event.pull_request.number }} || true
  19. git config --global user.email "infra-tech@provectus.com"
  20. git config --global user.name "infra-tech"
  21. git add ../kafka-ui-from-branch/
  22. git commit -m "removed env:${{ needs.build.outputs.deploy }}" && git push || true