File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 55 types : [ opened, edited ] 
66
77jobs :
8+  check-title :
9+  runs-on : ubuntu-latest 
10+  steps :
11+  - name : Check PR title 
12+  env :
13+  PR_TITLE : ${{ github.event.pull_request.title }} 
14+  run : | 
15+  echo "Checking PR Title: '$PR_TITLE'" 
16+  if [[ ! "$PR_TITLE" =~ ^Answer: ]]; then 
17+  echo "❌ PR title should start with 'Answer:[#challenge number]'" 
18+  echo "### ❌ PR title should start with 'Answer:[#challenge number]'" >> $GITHUB_STEP_SUMMARY 
19+  exit 1 
20+  else 
21+  echo "✅ PR title format is correct." 
22+  echo "### ✅ PR title format is correct." >> $GITHUB_STEP_SUMMARY 
23+  fi 
824add_labels :
925 runs-on : ubuntu-latest 
1026 if : ${{ startsWith(github.event.pull_request.title, 'Answer') }} 
1935 uses : ./.github/github-action/ 
2036 with :
2137 github_token : ${{ secrets.GITHUB_TOKEN }} 
22-  wrong_labels :
23-  runs-on : ubuntu-latest 
24-  if : ${{ !startsWith(github.event.pull_request.title, 'Answer') }} 
25-  steps :
26-  - name : Set the value in bash 
27-  id : step_one 
28-  run : | 
29-  echo "::error PR title should start with Answer:[number of challenge]" >> $GITHUB_STEP_SUMMARY 
                         You can’t perform that action at this time. 
           
                  
0 commit comments