Skip to content

Commit fedfc17

Browse files
committed
ci: update workflow
1 parent 4ade1bf commit fedfc17

File tree

2 files changed

+127
-4
lines changed

2 files changed

+127
-4
lines changed

.github/workflows/issues-new-assign.yml

Lines changed: 126 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
# ---------------------------------------------------------------------------------------
7171

7272
issues-preconfig-labels:
73-
name: ⚙️ Labels › Preconfigure
73+
name: ⚙️ Preconfigure
7474
runs-on: ubuntu-latest
7575
steps:
7676

@@ -136,6 +136,7 @@ jobs:
136136
name: Orion
137137
steps:
138138

139+
139140
# ---------------------------------------------------------------------------------------
140141
# Get Issue Title
141142
# ---------------------------------------------------------------------------------------
@@ -154,6 +155,7 @@ jobs:
154155
155156
console.log( "\n\n" )
156157
158+
157159
# ---------------------------------------------------------------------------------------
158160
# Label > Bug
159161
# ---------------------------------------------------------------------------------------
@@ -445,7 +447,7 @@ jobs:
445447
Find regex based phrases
446448
*/
447449
448-
const findWordList = /(?:(?:this)?is\s*a?n?\s*?(?:emergency|urgent|important|vital|acute|crucial|grave|pressing|serious|top.?priority|high.?priority))|(?:reply|respond|answer|write|address)\s*(?:immediate|quick|asap|urgent|now|fast|(?:as)?\s*(?:soon|quick|immediate|fast))(?:ly)?|(?:need\s*(?:help|support|fixed|answer|reply|response)!)/igm;
450+
const findWordList = /\b(?:(?:this)?is\s*a?n?\s*?(?:emergency|urgent|important|vital|acute|crucial|grave|pressing|serious|top.?priority|high.?priority))|(?:reply|respond|answer|write|address)\s*(?:immediate|quick|asap|urgent|now|fast|(?:as)?\s*(?:soon|quick|immediate|fast))(?:ly)?|(?:need\s*(?:help|support|fixed|answer|reply|response)!)|(?:emergency|critical|urgen(?:t|cy)|high.?priority)\b/igm;
449451
const bFoundMatchTitle = Boolean( findWordList.test( iss_title ) );
450452
const bFoundMatchBody = Boolean( findWordList.test( iss_body ) );
451453
@@ -632,13 +634,134 @@ jobs:
632634
core.setOutput( 'issue_title', iss_title )
633635
console.log( "\n\n" )
634636
637+
# ---------------------------------------------------------------------------------------
638+
# Phrases - Search
639+
# ---------------------------------------------------------------------------------------
640+
641+
issues-phrase-search:
642+
name: >-
643+
🏷️ Labels › Phrase Search
644+
needs:
645+
- issues-preconfig-labels
646+
runs-on: ubuntu-latest
647+
permissions:
648+
contents: 'read'
649+
id-token: 'write'
650+
issues: 'write'
651+
environment:
652+
name: Orion
653+
steps:
654+
655+
# ---------------------------------------------------------------------------------------
656+
# checkout
657+
# ---------------------------------------------------------------------------------------
658+
659+
- name: "☑️ Prepare"
660+
id: issues-labels-check-checkout
661+
uses: actions/checkout@v4
662+
with:
663+
fetch-depth: 0
664+
665+
- name: 👄 Search Phrases
666+
uses: actions/github-script@v7
667+
with:
668+
github-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
669+
script: |
670+
const fs = require( 'fs' );
671+
const iss_title = `${ context.payload.issue.title }`;
672+
const iss_body = `${ context.payload.issue.body }`;
673+
let message = [ "\n<br />\n" ]
674+
let bHasMessage = false
675+
676+
/*********************************************
677+
Keyword > OpenGist
678+
**********************************************/
679+
680+
let OG_message =
681+
`
682+
⚠️ It appears you may be looking for OpenGist help.
683+
- [Opengist Repo](https://github.com/thomiceli/opengist)
684+
- [Opengist Docs](https://github.com/thomiceli/opengist/blob/master/docs/index.md)
685+
- [Opengist Demo](https://opengist.thomice.li/all)
686+
687+
If you are looking for OpenGist support, it will be very minimal. Please utilize the links above.
688+
689+
---
690+
691+
<sub>I am a bot reaching out to you with an automated response. If the above info doesn't apply to you, please ignore it.</sub>
692+
`;
693+
694+
/*
695+
Check for keyword in message title and body
696+
*/
697+
698+
const OGfindWordList = /(\s*open\s*-?gist\s*)/ig;
699+
const OGbFoundMatchTitle = Boolean( OGfindWordList.test( iss_title ) );
700+
const OGbFoundMatchBody = Boolean( OGfindWordList.test( iss_body ) );
701+
702+
/*
703+
found searched word "Opengist"
704+
append / prepare message for bot to send
705+
*/
706+
707+
if ( OGbFoundMatchTitle || OGbFoundMatchBody )
708+
{
709+
message.push ( OG_message );
710+
bHasMessage = true;
711+
}
712+
713+
/*********************************************
714+
Keyword > Help
715+
**********************************************/
716+
717+
let HE_message =
718+
`
719+
💡 It appears you might need help, please check the resources below for documentation that might assist with your issue:
720+
- [Gistr Documentation](https://aetherinox.github.io/obsidian-gistr)
721+
- [Obsidian Documentation](https://help.obsidian.md/Home)
722+
723+
---
724+
725+
<sub>I am a bot reaching out to you with an automated response. If the above info doesn't apply to you, please ignore it.</sub>
726+
`;
727+
728+
/*
729+
found searched word "for help"
730+
append / prepare message for bot to send
731+
*/
732+
733+
const HEfindWordList = /^\b(?:have\s*(?:a|some)?\s*question*s?)|(?:can\s*you\s*(?:tell|help)\s*me)|(?:need\s*(?:some)?\s*(?:help|assistance|guidance))|(?:how\s*can\s*I\s*find)|(?:point\s*me\s*in\s*the\s*direction)|(?:where\s*can\s*I\s*find)|(?:where\s*(?:\N*)\s*(?:\N*)\s*find)|(?:please\s*help)|(?:where\s*\N*\s*(?:located|at))|(?:documentation)\b$/igm;
734+
const HEbFoundMatchTitle = Boolean( HEfindWordList.test( iss_title ) );
735+
const HEbFoundMatchBody = Boolean( HEfindWordList.test( iss_body ) );
736+
737+
if ( HEbFoundMatchTitle || HEbFoundMatchBody )
738+
{
739+
message.push ( HE_message );
740+
bHasMessage = true;
741+
}
742+
743+
/*
744+
Bot has message to send
745+
*/
746+
747+
if ( bHasMessage == true )
748+
{
749+
await github.rest.issues.createComment(
750+
{
751+
issue_number: context.issue.number,
752+
owner: context.repo.owner,
753+
repo: context.repo.repo,
754+
body: message.join('\n'),
755+
} );
756+
}
757+
635758
# ---------------------------------------------------------------------------------------
636759
# Issues > Add Assignees
637760
# ---------------------------------------------------------------------------------------
638761

639762
issues-assign-assignees:
640763
name: >-
641-
✍️ Issue › Assign
764+
✍️ Issue › Assignees
642765
runs-on: ubuntu-latest
643766
needs: [ issues-assign-labels ]
644767
if: |

.github/workflows/pr-issues-status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ jobs:
387387
Find regex based phrases
388388
*/
389389

390-
const urgn_findWordList = /(?:(?:this)?is\s*a?n?\s*?(?:emergency|urgent|important|vital|acute|crucial|grave|pressing|serious|top.?priority|high.?priority))|(?:reply|respond|answer|write|address)\s*(?:immediate|quick|asap|urgent|now|fast|(?:as)?\s*(?:soon|quick|immediate|fast))(?:ly)?|(?:need\s*(?:help|support|fixed|answer|reply|response)!)/igm;
390+
const urgn_findWordList = /\b(?:(?:this)?is\s*a?n?\s*?(?:emergency|urgent|important|vital|acute|crucial|grave|pressing|serious|top.?priority|high.?priority))|(?:reply|respond|answer|write|address)\s*(?:immediate|quick|asap|urgent|now|fast|(?:as)?\s*(?:soon|quick|immediate|fast))(?:ly)?|(?:need\s*(?:help|support|fixed|answer|reply|response)!)|(?:emergency|critical|urgen(?:t|cy)|high.?priority)\b/igm;
391391
const urgn_bFoundMatchTitle = Boolean( urgn_findWordList.test( iss_title ) );
392392
const urgn_bFoundMatchBody = Boolean( urgn_findWordList.test( iss_body ) );
393393

0 commit comments

Comments
 (0)