11const { PR_NUMBER , PR_TITLE , AREAS } = require ( "./constants" )
22
33module . exports = async ( { github, context, core} ) => {
4- const FEAT_REGEX = / f e a t ( \( ( .+ ) \) ) ? ( \ : .+ ) /
5- const BUG_REGEX = / ( f i x | b u g ) ( \( ( .+ ) \) ) ? ( \ : .+ ) /
6- const DOCS_REGEX = / ( d o c s | d o c ) ( \( ( .+ ) \) ) ? ( \ : .+ ) /
7- const CHORE_REGEX = / ( c h o r e ) ( \( ( .+ ) \) ) ? ( \ : .+ ) /
8- const DEPRECATED_REGEX = / ( d e p r e c a t e d ) ( \( ( .+ ) \) ) ? ( \ : .+ ) /
9- const REFACTOR_REGEX = / ( r e f a c t o r ) ( \( ( .+ ) \) ) ? ( \ : .+ ) /
4+ const FEAT_REGEX = / f e a t ( \( ( .+ ) \) ) ? ( : .+ ) /
5+ const BUG_REGEX = / ( f i x | b u g ) ( \( ( .+ ) \) ) ? ( : .+ ) /
6+ const DOCS_REGEX = / ( d o c s | d o c ) ( \( ( .+ ) \) ) ? ( : .+ ) /
7+ const CHORE_REGEX = / ( c h o r e ) ( \( ( .+ ) \) ) ? ( : .+ ) /
8+ const DEPRECATED_REGEX = / ( d e p r e c a t e d ) ( \( ( .+ ) \) ) ? ( : .+ ) /
9+ const REFACTOR_REGEX = / ( r e f a c t o r ) ( \( ( .+ ) \) ) ? ( : .+ ) /
1010
1111 const labels = {
1212 "feature" : FEAT_REGEX ,
@@ -22,8 +22,8 @@ module.exports = async ({github, context, core}) => {
2222 try {
2323 for ( const label in labels ) {
2424 const matcher = new RegExp ( labels [ label ] )
25- const isMatch = matcher . exec ( PR_TITLE )
26- if ( isMatch != null ) {
25+ const matches = matcher . exec ( PR_TITLE )
26+ if ( matches != null ) {
2727 core . info ( `Auto-labeling PR ${ PR_NUMBER } with ${ label } ` )
2828
2929 await github . rest . issues . addLabels ( {
@@ -54,7 +54,7 @@ module.exports = async ({github, context, core}) => {
5454 }
5555 } finally {
5656 if ( miss == Object . keys ( labels ) . length ) {
57- return core . notice ( `PR ${ PR_NUMBER } title '${ PR_TITLE } ' doesn't follow semantic titles; skipping...` )
57+ core . notice ( `PR ${ PR_NUMBER } title '${ PR_TITLE } ' doesn't follow semantic titles; skipping...` )
5858 }
5959 }
6060}
0 commit comments