mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			768 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			768 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
 | 
						|
name: Delete JSON date PR  Branch
 | 
						|
 | 
						|
on:
 | 
						|
  pull_request:
 | 
						|
    types: [closed]
 | 
						|
    branches:
 | 
						|
      - main
 | 
						|
 | 
						|
jobs:
 | 
						|
  delete_branch:
 | 
						|
    runs-on: runner-cluster-htl-set
 | 
						|
    steps:
 | 
						|
      - name: Checkout the code
 | 
						|
        uses: actions/checkout@v3
 | 
						|
 | 
						|
      - name: Delete PR Update Branch
 | 
						|
        if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'pr-update-json-')
 | 
						|
        run: |
 | 
						|
          PR_BRANCH="${{ github.event.pull_request.head.ref }}"
 | 
						|
          echo "Deleting branch $PR_BRANCH..."
 | 
						|
 | 
						|
          # Avoid deleting the default branch (e.g., main)
 | 
						|
          if [[ "$PR_BRANCH" != "main" ]]; then
 | 
						|
            git push origin --delete "$PR_BRANCH"
 | 
						|
          else
 | 
						|
            echo "Skipping deletion of the main branch"
 | 
						|
          fi |