mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 05:15:42 -04:00
ci: update issues workflow
This commit is contained in:
154
.github/workflows/issues-stale.yml
vendored
154
.github/workflows/issues-stale.yml
vendored
@@ -272,9 +272,8 @@ jobs:
|
||||
job-issues-nolabel:
|
||||
name: >-
|
||||
🎫 Labels › Assign Missing
|
||||
# runs-on: ubuntu-latest
|
||||
runs-on: apollo-x64
|
||||
timeout-minutes: 5
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 4
|
||||
needs: job-labels-create
|
||||
steps:
|
||||
|
||||
@@ -434,16 +433,46 @@ jobs:
|
||||
if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
|
||||
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( ) ) )
|
||||
{
|
||||
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, '' );
|
||||
title_new = title.replace( /^\s?fail\s*(.*?)\b/gi, '' );
|
||||
title_new = title.replace( /^\s?issue\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 }` )
|
||||
|
||||
await github.rest.issues.update(
|
||||
{
|
||||
owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number,
|
||||
@@ -464,7 +493,7 @@ jobs:
|
||||
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_bFoundMatchBody = Boolean( feat_findWordList.test( iss_body ) );
|
||||
|
||||
@@ -494,15 +523,42 @@ jobs:
|
||||
if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
|
||||
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( ) ) )
|
||||
{
|
||||
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, '' );
|
||||
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 }`;
|
||||
iss_title = `${ feat_tag } ${ title_new }`; // change TAG per category
|
||||
}
|
||||
|
||||
console.log( `New Title: ...................... ${ iss_title }` )
|
||||
@@ -557,10 +613,37 @@ jobs:
|
||||
if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
|
||||
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( ) ) )
|
||||
{
|
||||
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, '' );
|
||||
title_new = title.replace( /^\s?urgent\s*(.*?)\b/gi, '' );
|
||||
title_new = title.replace( /^\s?urgency\s*(.*?)\b/gi, '' );
|
||||
@@ -569,6 +652,8 @@ jobs:
|
||||
iss_title = `${ urgn_tag } ${ title_new }`;
|
||||
}
|
||||
|
||||
console.log( `New Title: ...................... ${ iss_title }` )
|
||||
|
||||
await github.rest.issues.update(
|
||||
{
|
||||
owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number,
|
||||
@@ -620,18 +705,45 @@ jobs:
|
||||
if ( author === `${{ env.BOT_NAME_RENOVATE }}` )
|
||||
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( ) ) )
|
||||
{
|
||||
const title = 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 = `${ road_tag } ${ title_new }`;
|
||||
|
||||
/*
|
||||
If a user creates an issue starting with our tag; strip it and add ours with the emoji instead
|
||||
original: Roadmap: CMD windows opens then closes, can't run the script.
|
||||
new: 🗺️ Roadmap: CMD windows opens then closes, can't run the script.
|
||||
*/
|
||||
|
||||
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(
|
||||
{
|
||||
owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number,
|
||||
|
||||
Reference in New Issue
Block a user