File tree 1 file changed +16
-8
lines changed
1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 5
5
types : [ opened, edited ]
6
6
7
7
jobs :
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
8
24
add_labels :
9
25
runs-on : ubuntu-latest
10
26
if : ${{ startsWith(github.event.pull_request.title, 'Answer') }}
19
35
uses : ./.github/github-action/
20
36
with :
21
37
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