ci: update issues workflow

This commit is contained in:
2025-05-03 04:13:41 -07:00
parent 9a9e4ebedf
commit 5973508f80
2 changed files with 268 additions and 52 deletions

View File

@@ -394,19 +394,45 @@ jobs:
if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ iss_author }` ) core.info( `Skipping: Detected ${ iss_author }` )
// Rename title to contain Bug: /*
// Make sure issue / pr title doesnt already contain a beginning title tag Rename title to contain Bug:
if bug title or body contains keyword hinting at the issue being about a bug; change the title of the issue
Make sure issue / pr title doesnt already contain a beginning title tag
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !bug_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !bug_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
console.log( "Renaming Title" ) console.log( "Renaming Title" )
console.log( `Old Title: .................. ${ iss_title }` ) console.log( `Old Title: .................. ${ iss_title }` )
const title = context.payload.issue.title /*
let title_new = title.replace( /^\s?bug\s*(.*?)\b/gi, '' ); If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
title_new = title.replace( /^\s?fail\s*(.*?)\b/gi, '' ); original: Bug: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?issue\s*(.*?)\b/gi, '' ); new: 🐛 Bug: CMD windows opens then closes, can't run the script.
iss_title = `${ bug_tag } ${ title_new }`; */
const removeBeginning1 = bug_tag.substring(3); // "Bug:"
let removeBeginning2 = bug_tag.substring(0); // "🐛 Bug:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Bug:"
if ( iss_title.startsWith(removeBeginning1) ) // "Bug:"
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) ) // "🐛Bug:"
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = iss_title;
let title_new = title.replace( /^\s?bug\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?fail\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?issue\s*(.*?)\b/gi, '' );
iss_title = `${ bug_tag } ${ title_new }`;
} }
console.log( `New Title: ...................... ${ iss_title }` ) console.log( `New Title: ...................... ${ iss_title }` )
@@ -540,20 +566,46 @@ jobs:
if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ iss_author }` ) core.info( `Skipping: Detected ${ iss_author }` )
// Rename title to contain Feature: /*
// Make sure issue / pr title doesnt already contain a beginning title tag Rename title to contain Feature:
if feature title or body contains keyword hinting at the issue being about a feature; change the title of the issue
Make sure issue / pr title doesnt already contain a beginning title tag
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !feat_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !feat_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
console.log( "Renaming Title" ) console.log( "Renaming Title" )
console.log( `Old Title: .................. ${ iss_title }` ) console.log( `Old Title: .................. ${ iss_title }` )
const title = context.payload.issue.title /*
let title_new = title.replace( /^\s?feature\s*(.*?)\b/gi, '' ); If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
title_new = title.replace( /^\s?request\s*(.*?)\b/gi, '' ); original: Feature: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?add(.*?)\s?feature\s*(.*?)\b/gi, '' ); new: 💡 Feature: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?add(.*?)\s?support\s*(.*?)\b/gi, '' ); */
iss_title = `${ feat_tag } ${ title_new }`; // change TAG per category
const removeBeginning1 = feat_tag.substring(3); // "Feature:"
let removeBeginning2 = feat_tag.substring(0); // "💡 Feature:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Feature:"
if ( iss_title.startsWith(removeBeginning1) ) // "Feature:"
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) ) // "💡 Feature:"
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = iss_title;
let title_new = title.replace( /^\s?feature\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?request\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?add(.*?)\s?feature\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?add(.*?)\s?support\s*(.*?)\b/gi, '' );
iss_title = `${ feat_tag } ${ title_new }`; // change TAG per category
} }
console.log( `New Title: ...................... ${ iss_title }` ) console.log( `New Title: ...................... ${ iss_title }` )
@@ -688,19 +740,45 @@ jobs:
if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ iss_author }` ) core.info( `Skipping: Detected ${ iss_author }` )
// Rename title to contain Roadmap: /*
// Make sure issue / pr title doesnt already contain a beginning title tag Rename title to contain Roadmap:
if roadmap title or body contains keyword hinting at the issue being about roadmap; change the title of the issue
Make sure issue / pr title doesnt already contain a beginning title tag
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !road_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !road_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
console.log( "Renaming Title" ) console.log( "Renaming Title" )
console.log( `Old Title: .................. ${ iss_title }` ) console.log( `Old Title: .................. ${ iss_title }` )
const title = context.payload.issue.title /*
let title_new = title.replace( /^\s?broad(.*?)\s?map\s*(.*?)\b/gi, '' ); If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
title_new = title.replace( /^\s?planned\s*(.*?)\b/gi, '' ); original: Roadmap: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?broadmap\s*(.*?)\b/gi, '' ); new: 🗺️ Roadmap: CMD windows opens then closes, can't run the script.
iss_title = `${ road_tag } ${ title_new }`; // change TAG per category */
const removeBeginning1 = road_tag.substring(3); // "Roadmap:"
let removeBeginning2 = road_tag.substring(0); // "🗺️ Roadmap:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Roadmap:"
if ( iss_title.startsWith(removeBeginning1) ) // "Roadmap:"
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) ) // "🗺️ Roadmap:"
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = iss_title;
let title_new = title.replace( /^\s?broad(.*?)\s?map\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?planned\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?broadmap\s*(.*?)\b/gi, '' );
iss_title = `${ road_tag } ${ title_new }`; // change TAG per category
} }
console.log( `New Title: .................... ${ iss_title }` ) console.log( `New Title: .................... ${ iss_title }` )
@@ -840,21 +918,47 @@ jobs:
if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( iss_author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ iss_author }` ) core.info( `Skipping: Detected ${ iss_author }` )
// Rename title to contain Urgent: /*
// Make sure issue / pr title doesnt already contain a beginning title tag Rename title to contain Urgent:
if urgent title or body contains keyword hinting at the issue being about urgent; change the title of the issue
Make sure issue / pr title doesnt already contain a beginning title tag
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !urgn_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( iss_author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !urgn_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
console.log( "Renaming Title" ) console.log( "Renaming Title" )
console.log( `Old Title: .................. ${ iss_title }` ) console.log( `Old Title: .................. ${ iss_title }` )
const title = context.payload.issue.title /*
let title_new = title.replace( /^\s?emergency\s*(.*?)\b/gi, '' ); If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
title_new = title.replace( /^\s?urgent\s*(.*?)\b/gi, '' ); original: Urgent: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?urgency\s*(.*?)\b/gi, '' ); new: ⚠ Urgent: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?important\s*(.*?)\b/gi, '' ); */
title_new = title.replace( /^\s?critical\s*(.*?)\b/gi, '' );
iss_title = `${ urgn_tag } ${ title_new }`; // change TAG per category const removeBeginning1 = urgn_tag.substring(3); // "Urgent:"
let removeBeginning2 = urgn_tag.substring(0); // "⚠ Urgent:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Urgent:"
if ( iss_title.startsWith(removeBeginning1) ) // "Urgent:"
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) ) // "⚠ Urgent:"
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = context.payload.issue.title;
let title_new = title.replace( /^\s?emergency\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?urgent\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?urgency\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?important\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?critical\s*(.*?)\b/gi, '' );
iss_title = `${ urgn_tag } ${ title_new }`;
} }
console.log( `New Title: ...................... ${ iss_title }` ) console.log( `New Title: ...................... ${ iss_title }` )

View File

@@ -272,9 +272,8 @@ jobs:
job-issues-nolabel: job-issues-nolabel:
name: >- name: >-
🎫 Labels Assign Missing 🎫 Labels Assign Missing
# runs-on: ubuntu-latest runs-on: ubuntu-latest
runs-on: apollo-x64 timeout-minutes: 4
timeout-minutes: 5
needs: job-labels-create needs: job-labels-create
steps: steps:
@@ -434,16 +433,46 @@ jobs:
if ( author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ author }` ) core.info( `Skipping: Detected ${ author }` )
// Rename title to contain Bug: /*
Rename title to contain Bug:
if bug title or body contains keyword hinting at the issue being about a bug; change the title of the issue
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !bug_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !bug_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
const title = issue.title;
/*
If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
original: Bug: CMD windows opens then closes, can't run the script.
new: 🐛 Bug: CMD windows opens then closes, can't run the script.
*/
const removeBeginning1 = bug_tag.substring(3); // "Bug:"
let removeBeginning2 = bug_tag.substring(0); // "🐛 Bug:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Bug:"
if ( iss_title.startsWith(removeBeginning1) )
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) )
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = iss_title;
let title_new = title.replace( /^\s?bug\s*(.*?)\b/gi, '' ); let title_new = title.replace( /^\s?bug\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?fail\s*(.*?)\b/gi, '' ); title_new = title.replace( /^\s?fail\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?issue\s*(.*?)\b/gi, '' ); title_new = title.replace( /^\s?issue\s*(.*?)\b/gi, '' );
iss_title = `${ bug_tag } ${ title_new }`; iss_title = `${ bug_tag } ${ title_new }`;
} }
console.log( `New Title: ...................... ${ iss_title }` )
await github.rest.issues.update( await github.rest.issues.update(
{ {
owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number,
@@ -464,7 +493,7 @@ jobs:
https://regex101.com/r/fR1Hm6/1 https://regex101.com/r/fR1Hm6/1
*/ */
const feat_findWordList = /(?:(?:add|enjoy|would|like|can|request|include|see|could|have)\s*?(?:the|liked?|i|we|an?|the|you?)\s*?(?:to|have|an|get|ability|request|add|feature|functionality|addon|addition|plugin|create))|(?:(?:add|see|get)\s*?support\s*?(?:for|with|of))|(?:can\s*we\s*get\s*?(?:the|a)\s*?(?:ability|feature))|(?:💡 Feature:)$/igm; const feat_findWordList = /(?:(?:add|enjoy|would|like|can|request|include|see|could|have)\s*?(?:the|liked?|i|we|an?|the|you?)\s*?(?:to|have|an|get|ability|request|add|feature|functionality|addon|addition|plugin|create))|(?:(?:add|see|get)\s*?support\s*?(?:for|with|of))|(?:can\s*we\s*get\s*?(?:the|a)\s*?(?:ability|feature))|(?:💡 Feature:)$/igm;
const feat_bFoundMatchTitle = Boolean( feat_findWordList.test( iss_title ) ); const feat_bFoundMatchTitle = Boolean( feat_findWordList.test( iss_title ) );
const feat_bFoundMatchBody = Boolean( feat_findWordList.test( iss_body ) ); const feat_bFoundMatchBody = Boolean( feat_findWordList.test( iss_body ) );
@@ -494,15 +523,42 @@ jobs:
if ( author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ author }` ) core.info( `Skipping: Detected ${ author }` )
// Rename title to contain Feature: /*
Rename title to contain Feature:
if feature title or body contains keyword hinting at the issue being about a feature; change the title of the issue
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !feat_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !feat_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
const title = issue.title;
/*
If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
original: Feature: CMD windows opens then closes, can't run the script.
new: 💡 Feature: CMD windows opens then closes, can't run the script.
*/
const removeBeginning1 = feat_tag.substring(3); // "Feature:"
let removeBeginning2 = feat_tag.substring(0); // "💡 Feature:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Feature:"
if ( iss_title.startsWith(removeBeginning1) )
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) )
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = iss_title;
let title_new = title.replace( /^\s?feature\s*(.*?)\b/gi, '' ); let title_new = title.replace( /^\s?feature\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?request\s*(.*?)\b/gi, '' ); title_new = title.replace( /^\s?request\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?add(.*?)\s?feature\s*(.*?)\b/gi, '' ); title_new = title.replace( /^\s?add(.*?)\s?feature\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?add(.*?)\s?support\s*(.*?)\b/gi, '' ); title_new = title.replace( /^\s?add(.*?)\s?support\s*(.*?)\b/gi, '' );
iss_title = `${ feat_tag } ${ title_new }`; iss_title = `${ feat_tag } ${ title_new }`; // change TAG per category
} }
console.log( `New Title: ...................... ${ iss_title }` ) console.log( `New Title: ...................... ${ iss_title }` )
@@ -557,10 +613,37 @@ jobs:
if ( author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ author }` ) core.info( `Skipping: Detected ${ author }` )
// Rename title to contain Urgent: /*
Rename title to contain Urgent:
if urgent title or body contains keyword hinting at the issue being about urgent; change the title of the issue
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !urgn_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !urgn_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
const title = issue.title;
/*
If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
original: Urgent: CMD windows opens then closes, can't run the script.
new: ⚠ Urgent: CMD windows opens then closes, can't run the script.
*/
const removeBeginning1 = urgn_tag.substring(3); // "Urgent:"
let removeBeginning2 = urgn_tag.substring(0); // "⚠ Urgent:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Urgent:"
if ( iss_title.startsWith(removeBeginning1) )
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) )
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = iss_title;
let title_new = title.replace( /^\s?emergency\s*(.*?)\b/gi, '' ); let title_new = title.replace( /^\s?emergency\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?urgent\s*(.*?)\b/gi, '' ); title_new = title.replace( /^\s?urgent\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?urgency\s*(.*?)\b/gi, '' ); title_new = title.replace( /^\s?urgency\s*(.*?)\b/gi, '' );
@@ -569,6 +652,8 @@ jobs:
iss_title = `${ urgn_tag } ${ title_new }`; iss_title = `${ urgn_tag } ${ title_new }`;
} }
console.log( `New Title: ...................... ${ iss_title }` )
await github.rest.issues.update( await github.rest.issues.update(
{ {
owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number,
@@ -620,18 +705,45 @@ jobs:
if ( author === `${{ env.BOT_NAME_RENOVATE }}` ) if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
core.info( `Skipping: Detected ${ author }` ) core.info( `Skipping: Detected ${ author }` )
// Rename title to contain Roadmap: /*
Rename title to contain Roadmap:
if roadmap title or body contains keyword hinting at the issue being about roadmap; change the title of the issue
@ref https://jsfiddle.net/aetherinox/wj17x8mp/2/
*/
if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !road_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) ) if ( author !== `${{ env.BOT_NAME_DEPENDABOT }}` && !road_bFoundPRTitle && !iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( feat_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( urgn_tag.toLowerCase( ) ) && !iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
{ {
const title = issue.title;
let title_new = title.replace( /^\s?emergency\s*(.*?)\b/gi, '' ); /*
title_new = title.replace( /^\s?urgent\s*(.*?)\b/gi, '' ); If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
title_new = title.replace( /^\s?urgency\s*(.*?)\b/gi, '' ); original: Roadmap: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?important\s*(.*?)\b/gi, '' ); new: 🗺️ Roadmap: CMD windows opens then closes, can't run the script.
title_new = title.replace( /^\s?critical\s*(.*?)\b/gi, '' ); */
iss_title = `${ road_tag } ${ title_new }`;
const removeBeginning1 = road_tag.substring(3); // "Roadmap:"
let removeBeginning2 = road_tag.substring(0); // "🗺️ Roadmap:"
removeBeginning2 = removeBeginning2.replace(/\s/g, '') // "Roadmap:"
if ( iss_title.startsWith(removeBeginning1) )
{
iss_title = iss_title.slice(removeBeginning1.length);
iss_title = iss_title.trim();
}
else if ( iss_title.startsWith(removeBeginning2) )
{
iss_title = iss_title.slice(removeBeginning2.length);
iss_title = iss_title.trim();
}
const title = iss_title;
let title_new = title.replace( /^\s?broad(.*?)\s?map\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?planned\s*(.*?)\b/gi, '' );
title_new = title.replace( /^\s?broadmap\s*(.*?)\b/gi, '' );
iss_title = `${ road_tag } ${ title_new }`; // change TAG per category
} }
console.log( `New Title: ...................... ${ iss_title }` )
await github.rest.issues.update( await github.rest.issues.update(
{ {
owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number,