Skip to content

Commit 3f3189c

Browse files
committed
ci: update workflows
1 parent 9540e23 commit 3f3189c

File tree

6 files changed

+284
-222
lines changed

6 files changed

+284
-222
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# ---------------------------------------------------------------------------------------
2+
# @parent : github workflow
3+
# @desc : adds a label and assignee when specified user types /accept in
4+
# PR comment.
5+
# @author : Aetherinox
6+
# @url : https://github.com/Aetherinox
7+
# ---------------------------------------------------------------------------------------
8+
9+
name: "🎫 Issue › Accept"
10+
run-name: "🎫 Issue › Accept"
11+
12+
# ---------------------------------------------------------------------------------------
13+
# triggers
14+
# ---------------------------------------------------------------------------------------
15+
16+
on:
17+
issue_comment:
18+
types: [created]
19+
20+
# ---------------------------------------------------------------------------------------
21+
# environment variables
22+
# ---------------------------------------------------------------------------------------
23+
24+
env:
25+
LABEL_ACCEPT: "Status 𐄂 Accepted"
26+
27+
ASSIGN_USER: Aetherinox
28+
BOT_NAME_1: AdminServ
29+
BOT_NAME_2: AdminServX
30+
BOT_NAME_3: EuropaServ
31+
BOT_NAME_DEPENDABOT: dependabot[bot]
32+
33+
# ---------------------------------------------------------------------------------------
34+
# jobs
35+
#
36+
# env not available for job.if
37+
# ---------------------------------------------------------------------------------------
38+
39+
jobs:
40+
deploy:
41+
runs-on: ubuntu-latest
42+
if: github.event.issue.pull_request && contains(github.event.comment.body, '/accept') && github.event.comment.user.login == 'Aetherinox'
43+
steps:
44+
45+
# ---------------------------------------------------------------------------------------
46+
# Add Label to accepted PR
47+
# ---------------------------------------------------------------------------------------
48+
49+
- name: "🏷️ Assign Label › ${{ env.LABEL_ACCEPT }}"
50+
run: gh issue edit "$NUMBER" --add-label "$LABELS"
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
GH_REPO: ${{ github.repository }}
54+
NUMBER: ${{ github.event.issue.number }}
55+
LABELS: ${{ env.LABEL_ACCEPT }}
56+
57+
# ---------------------------------------------------------------------------------------
58+
# Add assignee to accepted PR
59+
# ---------------------------------------------------------------------------------------
60+
61+
- name: "🏷️ Assign Assignee › ${{ env.ASSIGN_USER }}"
62+
run: gh issue edit "$NUMBER" --add-assignee "$ASSIGNEE"
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
GH_REPO: ${{ github.repository }}
66+
NUMBER: ${{ github.event.issue.number }}
67+
ASSIGNEE: ${{ env.ASSIGN_USER }}

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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# - roadmap
1212
# ---------------------------------------------------------------------------------------
1313

14-
name: "🎫 Issue › New › Assignment"
15-
run-name: "🎫 Issue › New › Assignment - ${{ github.event.issue.number }}: ${{ github.event.issue.title }}"
14+
name: "🎫 Issue › New"
15+
run-name: "🎫 Issue › New › ${{ github.event.issue.number }}: ${{ github.event.issue.title }}"
1616

1717
# ---------------------------------------------------------------------------------------
1818
# triggers
@@ -50,6 +50,7 @@ env:
5050
ASSIGN_USER: Aetherinox
5151
BOT_NAME_1: AdminServ
5252
BOT_NAME_2: AdminServX
53+
BOT_NAME_3: EuropaServ
5354
BOT_NAME_DEPENDABOT: dependabot[bot]
5455

5556
LABELS_JSON: |
@@ -78,7 +79,7 @@ jobs:
7879
steps:
7980

8081
- name: "✅ Start"
81-
run: |
82+
run: |
8283
echo "Assigning labels and assignees"
8384
8485
- name: "☑️ Checkout"
@@ -89,7 +90,7 @@ jobs:
8990
# ---------------------------------------------------------------------------------------
9091
# Check if repo has labels currently added to issues
9192
# ---------------------------------------------------------------------------------------
92-
93+
9394
- name: 🏷️ Verify Existing Labels
9495
uses: actions/github-script@v7
9596
with:
@@ -157,7 +158,7 @@ jobs:
157158
core.info( `Setting env issue title: ${ iss_title }` )
158159
159160
console.log( "\n\n" )
160-
161+
161162
162163
# ---------------------------------------------------------------------------------------
163164
# Label > Bug
@@ -239,7 +240,7 @@ jobs:
239240
240241
/*
241242
- Check if issue title matches the issue label "Bug:"
242-
- Check if title contains word in words
243+
- Check if title contains word in words
243244
*/
244245
245246
if ( iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) || bIncWordT || bFoundMatchTitle || bFoundMatchBody )
@@ -252,7 +253,7 @@ jobs:
252253
console.log( "Already starts with " + road_tag + " ..... " + iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
253254
254255
add_labels.push( `${ bug_lbl }` );
255-
256+
256257
console.log( `Adding Tag ....................... ${ bug_lbl }` )
257258
console.log( "\n" )
258259
@@ -285,7 +286,7 @@ jobs:
285286
286287
core.setOutput( 'issue_title', iss_title )
287288
console.log( "\n\n" )
288-
289+
289290
# ---------------------------------------------------------------------------------------
290291
# Label > FEATURE
291292
# ---------------------------------------------------------------------------------------
@@ -365,7 +366,7 @@ jobs:
365366
366367
/*
367368
- Check if issue title matches the issue label "Feature:"
368-
- Check if title contains word in words
369+
- Check if title contains word in words
369370
*/
370371
371372
// change TAG per category
@@ -494,7 +495,7 @@ jobs:
494495
495496
/*
496497
- Check if issue title matches the issue label "Urgent:"
497-
- Check if title contains word in words
498+
- Check if title contains word in words
498499
*/
499500
500501
// change TAG per category
@@ -625,7 +626,7 @@ jobs:
625626
626627
/*
627628
- Check if issue title matches the issue label "Roadmap:"
628-
- Check if title contains word in words
629+
- Check if title contains word in words
629630
*/
630631
631632
// change TAG per category
@@ -691,7 +692,7 @@ jobs:
691692
environment:
692693
name: Orion
693694
steps:
694-
695+
695696
# ---------------------------------------------------------------------------------------
696697
# checkout
697698
# ---------------------------------------------------------------------------------------
@@ -757,8 +758,7 @@ jobs:
757758
let HE_message =
758759
`
759760
💡 It appears you might need help, please check the resources below for documentation that might assist with your issue:
760-
- [Gistr Documentation](https://aetherinox.github.io/obsidian-gistr)
761-
- [Obsidian Documentation](https://help.obsidian.md/Home)
761+
- [Snippet Bundle Documentation](https://aetherinox.github.io/obsidian-dataview-snippets)
762762
763763
---
764764
@@ -779,7 +779,7 @@ jobs:
779779
message.push ( HE_message );
780780
bHasMessage = true;
781781
}
782-
782+
783783
/*
784784
Bot has message to send
785785
*/
@@ -836,4 +836,3 @@ jobs:
836836
core.setFailed( error.message );
837837
}
838838
}
839-

.github/workflows/pr-autoscan.yml renamed to .github/workflows/issues-scan.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# @url : https://github.com/Aetherinox
66
# ---------------------------------------------------------------------------------------
77

8-
name: "⚡ PRAutoscan"
9-
run-name: "⚡ PRAutoscan"
8+
name: "🎫 IssuesScan"
9+
run-name: "🎫 IssuesScan"
1010

1111
# ---------------------------------------------------------------------------------------
1212
# triggers
@@ -167,10 +167,15 @@ jobs:
167167
uses: actions/setup-node@v4
168168

169169
# ---------------------------------------------------------------------------------------
170-
# get list of changed files
170+
# get list of changed files
171+
#
172+
# Effortlessly track all changed files and directories relative to a target branch,
173+
# the current branch (preceding commit or the last remote commit), multiple branches,
174+
# or custom commits returning relative paths from the project root using this
175+
# GitHub action.
171176
# ---------------------------------------------------------------------------------------
172177

173-
- name: Get changed files
178+
- name: "📄 Get changed files"
174179
id: task_autocheck_changed_files_get
175180
uses: tj-actions/changed-files@v44
176181
with:
@@ -196,6 +201,10 @@ jobs:
196201
COUNT_RENAMED: ${{ steps.task_autocheck_changed_files_get.outputs.renamed_files_count }}
197202
COUNT_COPIED: ${{ steps.task_autocheck_changed_files_get.outputs.copied_files_count }}
198203

204+
# ---------------------------------------------------------------------------------------
205+
# List directories
206+
# ---------------------------------------------------------------------------------------
207+
199208
- name: "📂 List Directories"
200209
id: task_autocheck_dirs_list
201210
run: |
@@ -285,7 +294,7 @@ jobs:
285294
"- `SampleModal`\n"
286295
287296
let warn_BadWords = "\n" +
288-
"- `Obsidian`\n" +
297+
"- `General`\n" +
289298
"- `Settings`\n"
290299
291300
/*
@@ -365,13 +374,13 @@ jobs:
365374
const bAsAny = /\((.*? as Any\s*)\)/gi.test( filesData );
366375
const bInnerHTML = /^\s?.*[a-zA-Z0-9_]+\.innerHTML*\s?.*$/gm.test( filesData );
367376
const bOuterHTML = /^\s?.*[a-zA-Z0-9_]+\.outerHTML*\s?.*$/gm.test( filesData );
368-
const bFuncConsoleLog = /(console.log)\((.*)\)(\[([^\]]*)\])?/gim.test( filesData );
377+
// const bFuncConsoleLog = /(console.log)\((.*)\)(\[([^\]]*)\])?/gim.test( filesData );
369378
const bFuncSetTimeout = /(setTimeout)\((.*)\)(\[([^\]]*)\])?/gim.test( filesData );
370379
const bFuncFS_Chk1 = /(require)\s?\((\s?(?:'|")fs(?:'|"))\s?\)?/gim.test( filesData );
371380
const bFuncFS_Chk2 = /from\s+(?:'|")fs(?:'|")\s?/gim.test( filesData );
372381
const bFuncFS_ExistsSync = /(fs.existsSync)\((.*)\)(\[([^\]]*)\])?/gm.test( filesData );
373382
const bFuncFS_MkdirSync = /(fs.mkdirSync)\((.*)\)(\[([^\]]*)\])?/gm.test( filesData );
374-
const bFoundBadWord = /(?:'|").*(Obsidian|Settings|General).*(?:'|")?/gmi.test( filesData );
383+
const bFoundBadWord = /(?:'|").*(Settings|General).*(?:'|")?/gmi.test( filesData );
375384
const bContainsGeneric = /(?:^|(?<= ))(MyPlugin|MyPluginSettings|SampleSettings|SampleSettingTab|SampleModal|Sample Plugin|my-plugin)(?:(?= )|$)/gim.test( filesData );
376385
const check_depGetUnpinnedLeaf = "app.workspace.getUnpinnedLeaf"
377386
@@ -406,10 +415,12 @@ jobs:
406415
@usage : obsidian.md
407416
*/
408417
418+
/*
409419
if ( filesData.toLowerCase( ).includes( check_depGetUnpinnedLeaf.toLowerCase( ) ) )
410420
{
411421
addError( "This function is deprecated, use `this.app.workspace.getLeaf( false )` instead" );
412422
}
423+
*/
413424
414425
/*
415426
Using inline style
@@ -489,7 +500,7 @@ jobs:
489500
490501
if ( bInnerHTML == true )
491502
{
492-
addError( `Using \`innerHTML\` is a security risk. Use the DOM API or the Obsidian helper functions: https://docs.obsidian.md/Plugins/User+interface/HTML+elements` );
503+
addError( `Using \`innerHTML\` is a security risk.` );
493504
}
494505
495506
/*
@@ -498,7 +509,7 @@ jobs:
498509
499510
if ( bOuterHTML == true )
500511
{
501-
addError( `Using \`outerHTML\` is a security risk. Use the DOM API or the Obsidian helper functions: https://docs.obsidian.md/Plugins/User+interface/HTML+elements` );
512+
addError( `Using \`outerHTML\` is a security risk.` );
502513
}
503514
504515
/*
@@ -516,7 +527,7 @@ jobs:
516527
517528
if ( bFuncFS_Chk1 == true || bFuncFS_Chk2 == true )
518529
{
519-
addError( "`fs` import only available from Node.js runtime, this will throw errors for users running Obsidian on mobile" );
530+
addError( "`fs` import only available from Node.js runtime, this will throw errors for users running on mobile" );
520531
}
521532
522533
/*
@@ -525,7 +536,7 @@ jobs:
525536
526537
if ( bFuncFS_ExistsSync == true )
527538
{
528-
addError( "`fs` import only available from Node.js runtime, this will throw errors for users running Obsidian on mobile. For `fs.existsSync( )`, utilize Obsidian API -> `this.app.vault.adapter.exists( )`" );
539+
addError( "`fs` import only available from Node.js runtime, this will throw errors for users running on mobile." );
529540
}
530541
531542
/*
@@ -534,7 +545,7 @@ jobs:
534545
535546
if ( bFuncFS_MkdirSync == true )
536547
{
537-
addError( "`fs` import only available from Node.js runtime, this will throw errors for users running Obsidian on mobile. For `fs.mkdirSync( )`, utilize Obsidian API -> `this.app.vault.adapter.mkdir( )`" );
548+
addError( "`fs` import only available from Node.js runtime, this will throw errors for users running on mobile." );
538549
}
539550
540551
/*
@@ -550,18 +561,20 @@ jobs:
550561
console.log found
551562
*/
552563
564+
/*
553565
if ( bFuncConsoleLog == true )
554566
{
555567
addWarning( "Avoid unnecessary logging or ensure logging only occurs in development environment." );
556568
}
569+
*/
557570
558571
/*
559572
Bad words found
560573
*/
561574
562575
if ( bFoundBadWord == true && file != "package.json" && file != "manifest.json" )
563576
{
564-
addWarning( "A restricted word was found in your code. Obsidian developers do not allow words in strings such as: " + warn_BadWords );
577+
addWarning( "A restricted word was found in your code. Generic words are not allowed in strings such as: " + warn_BadWords );
565578
}
566579
567580
if ( errors.length > 0 || warnings.length > 0 )

0 commit comments

Comments
 (0)