File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Load Diff This file was deleted. 
Original file line number Diff line number Diff line change 1+ name : Close Matching Issue on PR Merge 
2+ 
3+ on :
4+   pull_request :
5+     types :
6+       - closed 
7+ 
8+ jobs :
9+   close_issue :
10+     if : github.event.pull_request.merged == true 
11+     runs-on : ubuntu-latest 
12+ 
13+     steps :
14+       - name : Extract PR Title in Lowercase 
15+         id : extract_title 
16+         run : echo "title=$(echo '${{ github.event.pull_request.title }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV 
17+ 
18+       - name : Search for Issue with Matching Title 
19+         id : find_issue 
20+         env :
21+           GH_TOKEN : ${{ secrets.GITHUB_TOKEN }} 
22+         run : | 
23+           ISSUE=$(gh issue list --repo community-scripts/ProxmoxVED --search "$title" --json number --jq '.[0].number') 
24+           if [ -n "$ISSUE" ]; then 
25+             echo "issue_number=$ISSUE" >> $GITHUB_ENV 
26+           else 
27+             echo "No matching issue found." 
28+             exit 0 
29+           fi 
30+ 
31+ name : Comment on Issue and Close It 
32+         if : env.issue_number != '' 
33+         env :
34+           GH_TOKEN : ${{ secrets.GITHUB_TOKEN }} 
35+         run : | 
36+           gh issue comment $issue_number --repo community-scripts/ProxmoxVED --body "Merged with #${{ github.event.pull_request.number }} in ProxmoxVE" 
37+           gh issue close $issue_number --repo community-scripts/ProxmoxVED 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments