-
Notifications
You must be signed in to change notification settings - Fork 7
1268 lines (1170 loc) · 55.8 KB
/
validate-plugin.yml
File metadata and controls
1268 lines (1170 loc) · 55.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: Validate Plugin
permissions:
contents: read
pull-requests: write
issues: write
security-events: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Comma-separated lists of blocked GitHub usernames and plugin slugs.
# Set these in repo Settings → Variables as AUTHOR_BLACKLIST and PLUGIN_BLACKLIST.
AUTHOR_BLACKLIST: ${{ vars.AUTHOR_BLACKLIST }}
PLUGIN_BLACKLIST: ${{ vars.PLUGIN_BLACKLIST }}
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- ready_for_review
concurrency:
group: validate-plugin-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
# --------------------------------------------------------------------------
# Job 1: Post a notice on draft PRs - no validation runs yet
# --------------------------------------------------------------------------
draft-notice:
if: github.event.pull_request.draft == true
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout config
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 1
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
- name: Load app ID from config
id: config
env:
GH_APP_ID: ${{ vars.GH_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
run: |
if [[ -n "${GH_APP_ID:-}" && -n "${GH_APP_PRIVATE_KEY:-}" ]]; then
echo "app_id=${GH_APP_ID}" >> "$GITHUB_OUTPUT"
echo "use_app=true" >> "$GITHUB_OUTPUT"
else
echo "use_app=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate GitHub App token
if: steps.config.outputs.use_app == 'true'
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ steps.config.outputs.app_id }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Log fallback to actions token
if: steps.config.outputs.use_app != 'true'
run: |
printf '## ⚠️ GitHub App token not available\n\nGH_APP_ID or GH_APP_PRIVATE_KEY not configured. Falling back to `GITHUB_TOKEN` (github-actions[bot] identity).\n' >> "$GITHUB_STEP_SUMMARY"
- name: Post draft notice
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ steps.config.outputs.use_app == 'true' && steps.app-token.outputs.token || github.token }}
BOT_LOGIN: ${{ steps.config.outputs.use_app == 'true' && format('{0}[bot]', steps.app-token.outputs.app-slug) || 'github-actions[bot]' }}
GH_REPO: ${{ github.repository }}
run: |
MARKER="<!--PLUGIN_VALIDATION_DRAFT_NOTICE-->"
COMMENT="$MARKER"$'\n'"This PR is currently a draft. Plugin validation will run once the PR is marked ready for review."
EXISTING=$(gh pr view $PR_NUMBER --json comments \
| jq -r --arg marker "$MARKER" --arg login "$BOT_LOGIN" '.comments[] | select(.author.login==$login) | select(.body | contains($marker)) | .id')
if [ -n "$EXISTING" ]; then
gh api "repos/${{ github.repository }}/issues/comments/$EXISTING" -X PATCH -f body="$COMMENT"
else
gh pr comment $PR_NUMBER --body "$COMMENT"
fi
# --------------------------------------------------------------------------
# Job 2: Detect which plugins changed and build the matrix
# --------------------------------------------------------------------------
detect-changes:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
matrix: ${{ steps.detect.outputs.matrix }}
plugin_count: ${{ steps.detect.outputs.plugin_count }}
close_pr: ${{ steps.blacklist.outputs.close_pr || steps.detect.outputs.close_pr }}
close_reason: ${{ steps.blacklist.outputs.close_reason || steps.detect.outputs.close_reason }}
outside_files: ${{ steps.detect.outputs.outside_files }}
outside_violation: ${{ steps.detect.outputs.outside_violation }}
skip_validation: ${{ steps.detect.outputs.skip_validation }}
pub_key_changed: ${{ steps.detect.outputs.pub_key_changed }}
has_new_plugin: ${{ steps.detect.outputs.has_new_plugin }}
has_updated_plugin: ${{ steps.detect.outputs.has_updated_plugin }}
steps:
- name: Checkout base branch scripts (trusted)
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
- name: Fetch base branch
run: git fetch origin ${{ github.event.pull_request.base.ref }}
- name: Save trusted scripts before fork checkout
run: cp -r .github/scripts /tmp/trusted-scripts
- name: Checkout PR plugins (untrusted content only)
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
sparse-checkout: plugins
sparse-checkout-cone-mode: false
clean: false
- name: Restore trusted scripts
run: mkdir -p .github && cp -r /tmp/trusted-scripts .github/scripts
- name: Re-fetch base branch refs
run: git fetch https://github.com/${{ github.repository }} +${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
- name: Load app ID from config
id: config
env:
GH_APP_ID: ${{ vars.GH_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
run: |
if [[ -n "${GH_APP_ID:-}" && -n "${GH_APP_PRIVATE_KEY:-}" ]]; then
echo "app_id=${GH_APP_ID}" >> "$GITHUB_OUTPUT"
echo "use_app=true" >> "$GITHUB_OUTPUT"
else
echo "use_app=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate GitHub App token
if: steps.config.outputs.use_app == 'true'
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ steps.config.outputs.app_id }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Log fallback to actions token
if: steps.config.outputs.use_app != 'true'
run: |
printf '## ⚠️ GitHub App token not available\n\nGH_APP_ID or GH_APP_PRIVATE_KEY not configured. Falling back to `GITHUB_TOKEN` (github-actions[bot] identity).\n' >> "$GITHUB_STEP_SUMMARY"
- name: Detect changed plugins
id: detect
env:
GH_TOKEN: ${{ steps.config.outputs.use_app == 'true' && steps.app-token.outputs.token || github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
chmod +x .github/scripts/validate/*.sh
.github/scripts/validate/detect-changes.sh \
"${{ github.event.pull_request.user.login }}" \
"${{ github.event.pull_request.base.ref }}"
- name: Check author and plugin blacklists
id: blacklist
# Only run if detect didn't already decide to close (avoids redundant output)
if: steps.detect.outputs.close_pr != 'true'
env:
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
MATRIX: ${{ steps.detect.outputs.matrix }}
run: |
AUTHOR_BL="${AUTHOR_BLACKLIST:-}"
PLUGIN_BL="${PLUGIN_BLACKLIST:-}"
# No-op if neither list is configured
if [[ -z "$AUTHOR_BL" && -z "$PLUGIN_BL" ]]; then
exit 0
fi
MATCHED=false
REASON=""
# Check author blacklist (case-insensitive, strips whitespace around commas)
if [[ -n "$AUTHOR_BL" ]]; then
IFS=',' read -ra BLOCKED <<< "$AUTHOR_BL"
for entry in "${BLOCKED[@]}"; do
slug="${entry// /}"
if [[ "${PR_AUTHOR,,}" == "${slug,,}" ]]; then
MATCHED=true
REASON="author-blacklisted"
echo "::warning::PR author '$PR_AUTHOR' is on the author blacklist."
break
fi
done
fi
# Check plugin blacklist (case-insensitive)
if [[ "$MATCHED" != "true" && -n "$PLUGIN_BL" ]]; then
IFS=',' read -ra BLOCKED <<< "$PLUGIN_BL"
while IFS= read -r plugin; do
[[ -z "$plugin" ]] && continue
for entry in "${BLOCKED[@]}"; do
slug="${entry// /}"
if [[ "${plugin,,}" == "${slug,,}" ]]; then
MATCHED=true
REASON="plugin-blacklisted"
echo "::warning::Plugin '$plugin' is on the plugin blacklist."
break 2
fi
done
done < <(printf '%s' "$MATRIX" | jq -r '.[]' 2>/dev/null || true)
fi
if [[ "$MATCHED" == "true" ]]; then
echo "close_pr=true" >> "$GITHUB_OUTPUT"
echo "close_reason=$REASON" >> "$GITHUB_OUTPUT"
fi
# --------------------------------------------------------------------------
# Job 3: Apply PR labels based on change classification
# --------------------------------------------------------------------------
label-pr:
needs: [detect-changes]
if: always() && needs.detect-changes.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout config
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 1
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
- name: Load app ID from config
id: config
env:
GH_APP_ID: ${{ vars.GH_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
run: |
if [[ -n "${GH_APP_ID:-}" && -n "${GH_APP_PRIVATE_KEY:-}" ]]; then
echo "app_id=${GH_APP_ID}" >> "$GITHUB_OUTPUT"
echo "use_app=true" >> "$GITHUB_OUTPUT"
else
echo "use_app=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate GitHub App token
if: steps.config.outputs.use_app == 'true'
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ steps.config.outputs.app_id }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Log fallback to actions token
if: steps.config.outputs.use_app != 'true'
run: |
printf '## ⚠️ GitHub App token not available\n\nGH_APP_ID or GH_APP_PRIVATE_KEY not configured. Falling back to `GITHUB_TOKEN` (github-actions[bot] identity).\n' >> "$GITHUB_STEP_SUMMARY"
- name: Apply labels
env:
GH_TOKEN: ${{ steps.config.outputs.use_app == 'true' && steps.app-token.outputs.token || github.token }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
HAS_NEW_PLUGIN: ${{ needs.detect-changes.outputs.has_new_plugin }}
HAS_UPDATED_PLUGIN: ${{ needs.detect-changes.outputs.has_updated_plugin }}
OUTSIDE_FILES: ${{ needs.detect-changes.outputs.outside_files }}
OUTSIDE_VIOLATION: ${{ needs.detect-changes.outputs.outside_violation }}
CLOSE_PR: ${{ needs.detect-changes.outputs.close_pr }}
run: |
apply_label() {
local label=$1 condition=$2
if [[ "$condition" == "true" ]]; then
gh pr edit "$PR_NUMBER" --add-label "$label" || true
else
gh pr edit "$PR_NUMBER" --remove-label "$label" 2>/dev/null || true
fi
}
apply_label "New Plugin" "$HAS_NEW_PLUGIN"
apply_label "Plugin Update" "$HAS_UPDATED_PLUGIN"
# Repo Update only when there are outside files AND it's not a violation (authorized)
if [[ -n "$OUTSIDE_FILES" && "$OUTSIDE_VIOLATION" != "true" ]]; then
IS_REPO_UPDATE=true
else
IS_REPO_UPDATE=false
fi
apply_label "Repo Update" "$IS_REPO_UPDATE"
# Invalid when PR has unauthorized outside changes or unauthorized plugin modifications
if [[ "$OUTSIDE_VIOLATION" == "true" || "$CLOSE_PR" == "true" ]]; then
IS_INVALID=true
else
IS_INVALID=false
fi
apply_label "Invalid" "$IS_INVALID"
# --------------------------------------------------------------------------
# Job 4: Validate PR title format
# Runs on every non-draft, non-closing PR event (including 'edited', which
# fires when the title is renamed).
# --------------------------------------------------------------------------
validate-title:
needs: [detect-changes]
if: github.event.pull_request.draft == false && needs.detect-changes.result == 'success' && needs.detect-changes.outputs.close_pr == 'false'
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
title_valid: ${{ steps.check.outputs.title_valid }}
title_feedback: ${{ steps.check.outputs.title_feedback }}
title_suggestion: ${{ steps.check.outputs.title_suggestion }}
steps:
- name: Validate PR title format
id: check
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PLUGIN_COUNT: ${{ needs.detect-changes.outputs.plugin_count }}
MATRIX: ${{ needs.detect-changes.outputs.matrix }}
SKIP_VALIDATION: ${{ needs.detect-changes.outputs.skip_validation }}
run: |
TITLE="$PR_TITLE"
AUTHOR="$PR_AUTHOR"
COUNT="${PLUGIN_COUNT:-0}"
SKIP="${SKIP_VALIDATION:-false}"
MATRIX_JSON="${MATRIX:-[]}"
TITLE_VALID=true
TITLE_FEEDBACK=""
TITLE_SUGGESTION=""
# Build a context-appropriate suggestion for this PR
if [[ "$COUNT" == "0" ]]; then
CONTEXT_SUGGESTION="[repo]: Brief description of changes"
elif [[ "$COUNT" == "1" ]]; then
SLUG=$(printf '%s' "$MATRIX_JSON" | jq -r '.[0] // "plugin-slug"' || echo "plugin-slug")
CONTEXT_SUGGESTION="[$SLUG]: Brief description of changes"
else
CONTEXT_SUGGESTION="[$AUTHOR]: Brief description of changes"
fi
# Check format and extract prefix using bash =~ to avoid grep/sed ERE inconsistencies.
# [^]] inside bash =~ means "not ]" (] is literal when first after [^).
if [[ "$TITLE" =~ ^\[([^]]+)\]:?[[:space:]]+.+ ]]; then
PREFIX="${BASH_REMATCH[1]}"
# Validate prefix matches expected context
if [[ "$COUNT" == "0" ]]; then
if [[ "$PREFIX" != "repo" ]]; then
TITLE_VALID=false
TITLE_FEEDBACK="For repo-level or non-plugin changes, the prefix should be \`[repo]\`."
TITLE_SUGGESTION="$CONTEXT_SUGGESTION"
fi
elif [[ "$COUNT" == "1" ]]; then
EXPECTED=$(printf '%s' "$MATRIX_JSON" | jq -r '.[0] // ""' || echo "")
if [[ -n "$EXPECTED" && "$PREFIX" != "$EXPECTED" ]]; then
TITLE_VALID=false
TITLE_FEEDBACK="For a single plugin change, the prefix should match the plugin folder name: \`[$EXPECTED]\`."
TITLE_SUGGESTION="$CONTEXT_SUGGESTION"
fi
else
if [[ "$PREFIX" != "$AUTHOR" ]]; then
TITLE_VALID=false
TITLE_FEEDBACK="For changes to multiple plugins, the prefix should be your GitHub username: \`[$AUTHOR]\`."
TITLE_SUGGESTION="$CONTEXT_SUGGESTION"
fi
fi
else
TITLE_VALID=false
TITLE_FEEDBACK="PR title does not match the required format. Expected: \`[prefix] description\`."
TITLE_SUGGESTION="$CONTEXT_SUGGESTION"
fi
echo "title_valid=$TITLE_VALID" >> "$GITHUB_OUTPUT"
{
echo "title_feedback<<ENDOFVALUE"
echo "$TITLE_FEEDBACK"
echo "ENDOFVALUE"
} >> "$GITHUB_OUTPUT"
{
echo "title_suggestion<<ENDOFVALUE"
echo "$TITLE_SUGGESTION"
echo "ENDOFVALUE"
} >> "$GITHUB_OUTPUT"
if [[ "$TITLE_VALID" != "true" ]]; then
echo "::error::PR title does not match the required format. See CONTRIBUTING.md for details."
exit 1
fi
# --------------------------------------------------------------------------
# Job 5: CodeQL security and quality analysis (runs after validate-plugin)
# --------------------------------------------------------------------------
codeql-analyze:
needs: [detect-changes, validate-plugin, validate-title]
if: needs.validate-plugin.result == 'success' && needs.detect-changes.outputs.skip_validation != 'true' && needs.validate-title.outputs.title_valid == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
codeql_status: ${{ steps.status.outputs.codeql_status }}
codeql_errors: ${{ steps.status.outputs.codeql_errors }}
codeql_warnings: ${{ steps.status.outputs.codeql_warnings }}
codeql_mediums: ${{ steps.status.outputs.codeql_mediums }}
codeql_lows: ${{ steps.status.outputs.codeql_lows }}
codeql_unscanned_langs: ${{ steps.status.outputs.codeql_unscanned_langs }}
steps:
- name: Checkout PR merge commit for analysis
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
# Minimal placeholder - overridden immediately by the next step
# (actions/checkout doesn't support dynamic expressions in sparse-checkout)
sparse-checkout: .gitignore
sparse-checkout-cone-mode: false
- name: Limit checkout to changed plugin folders only
run: |
echo '${{ needs.detect-changes.outputs.matrix }}' \
| jq -r '.[] | "plugins/\(.)"' \
| git sparse-checkout set --stdin
git checkout
- name: Detect supported languages
id: detect-langs
run: |
LANGS=()
UNSCANNED=()
# --- CodeQL-supported languages ---
if find plugins -name '*.py' -print -quit | grep -q .; then
LANGS+=(python)
fi
if find plugins \( -name '*.js' -o -name '*.ts' -o -name '*.jsx' -o -name '*.tsx' \) -print -quit | grep -q .; then
LANGS+=(javascript)
fi
if find plugins -name '*.go' -print -quit | grep -q .; then
LANGS+=(go)
fi
if find plugins -name '*.rb' -print -quit | grep -q .; then
LANGS+=(ruby)
fi
if find plugins \( -name '*.java' -o -name '*.kt' -o -name '*.kts' \) -print -quit | grep -q .; then
LANGS+=("java-kotlin")
fi
if find plugins \( -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.hpp' \) -print -quit | grep -q .; then
LANGS+=("c-cpp")
fi
# --- Files present but not supported by CodeQL ---
if find plugins \( -name '*.sh' -o -name '*.bash' \) -print -quit | grep -q .; then
UNSCANNED+=(shell)
fi
if find plugins -name '*.php' -print -quit | grep -q .; then
UNSCANNED+=(php)
fi
if find plugins -name '*.lua' -print -quit | grep -q .; then
UNSCANNED+=(lua)
fi
if find plugins \( -name '*.pl' -o -name '*.pm' \) -print -quit | grep -q .; then
UNSCANNED+=(perl)
fi
if find plugins -name '*.rs' -print -quit | grep -q .; then
UNSCANNED+=(rust)
fi
UNSCANNED_CSV=""
[[ ${#UNSCANNED[@]} -gt 0 ]] && UNSCANNED_CSV=$(IFS=,; echo "${UNSCANNED[*]}")
echo "unscanned_langs=$UNSCANNED_CSV" >> "$GITHUB_OUTPUT"
if [[ ${#LANGS[@]} -gt 0 ]]; then
LANG_CSV=$(IFS=,; echo "${LANGS[*]}")
echo "found=true" >> "$GITHUB_OUTPUT"
echo "languages=$LANG_CSV" >> "$GITHUB_OUTPUT"
echo "Detected languages for CodeQL: $LANG_CSV"
if [[ -n "$UNSCANNED_CSV" ]]; then echo "Unscanned (no CodeQL support): $UNSCANNED_CSV"; fi
else
echo "found=false" >> "$GITHUB_OUTPUT"
echo "languages=" >> "$GITHUB_OUTPUT"
echo "No supported language files found in changed plugins - skipping CodeQL."
if [[ -n "$UNSCANNED_CSV" ]]; then echo "Unscanned file types detected (no CodeQL support): $UNSCANNED_CSV"; fi
fi
- name: Get merge commit SHA
id: merge
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Initialize CodeQL
if: steps.detect-langs.outputs.found == 'true'
uses: github/codeql-action/init@v4
with:
languages: ${{ steps.detect-langs.outputs.languages }}
# Query suite options (slowest → fastest):
# security-and-quality – security + maintainability/style (quality results are discarded by our SARIF filter anyway)
# security-extended – all security severities, no quality queries (current)
# (omit queries:) – high-confidence security only; drops CVSS 6.0–6.9 medium findings our report surfaces
queries: security-extended
- name: Autobuild
if: steps.detect-langs.outputs.found == 'true'
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
if: steps.detect-langs.outputs.found == 'true'
id: analyze
uses: github/codeql-action/analyze@v4
with:
category: pr-${{ github.event.pull_request.number }}
output: sarif-results
upload: false
continue-on-error: true
- name: Set CodeQL status output
id: status
if: always()
run: |
# Only block on security findings with CVSS score >= 7.0 (HIGH or CRITICAL).
# CodeQL stores this in rule properties["security-severity"], not in result.level.
JQ_BLOCKING='
[ .runs[] |
. as $run |
(
[ (($run.tool.driver.rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}),
((($run.tool.extensions // [])[].rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}) ]
| from_entries
) as $secmap |
($run.results // [])[] |
((.ruleId // .rule.id // "") | tostring) as $rid |
select((($secmap[$rid] // "0") | tonumber) >= 7.0)
] | length'
JQ_MEDIUM='
[ .runs[] |
. as $run |
(
[ (($run.tool.driver.rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}),
((($run.tool.extensions // [])[].rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}) ]
| from_entries
) as $secmap |
($run.results // [])[] |
((.ruleId // .rule.id // "") | tostring) as $rid |
(($secmap[$rid] // "0") | tonumber) as $sev |
select($sev >= 6.0 and $sev < 7.0)
] | length'
JQ_LOW='
[ .runs[] |
. as $run |
(
[ (($run.tool.driver.rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}),
((($run.tool.extensions // [])[].rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}) ]
| from_entries
) as $secmap |
($run.results // [])[] |
((.ruleId // .rule.id // "") | tostring) as $rid |
(($secmap[$rid] // "0") | tonumber) as $sev |
select($sev < 6.0)
] | length'
RESULT_COUNT=0
MEDIUM_COUNT=0
LOW_COUNT=0
TOTAL_COUNT=0
if [[ -d "sarif-results" ]]; then
for f in sarif-results/*.sarif sarif-results/*.sarif.gz; do
[[ -f "$f" ]] || continue
if [[ "$f" == *.gz ]]; then
CONTENT=$(gunzip -c "$f")
else
CONTENT=$(cat "$f")
fi
COUNT=$(echo "$CONTENT" | jq "$JQ_BLOCKING")
MED=$(echo "$CONTENT" | jq "$JQ_MEDIUM")
LOW=$(echo "$CONTENT" | jq "$JQ_LOW")
TOT=$(echo "$CONTENT" | jq '[.runs[] | (.results // [])[]] | length')
echo "File $f: ${COUNT:-0} blocking, ${MED:-0} medium, ${LOW:-0} low, $TOT total"
echo "$CONTENT" | jq -r \
'[ .runs[] | . as $run |
([ (($run.tool.driver.rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}),
((($run.tool.extensions // [])[].rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}) ] | from_entries) as $secmap |
($run.results // [])[] |
((.ruleId // .rule.id // "") | tostring) as $rid |
select((($secmap[$rid] // "0") | tonumber) >= 7.0) |
" [blocking] \($rid) sec-sev=\($secmap[$rid] // "n/a")" ] | .[]' || true
RESULT_COUNT=$((RESULT_COUNT + ${COUNT:-0}))
MEDIUM_COUNT=$((MEDIUM_COUNT + ${MED:-0}))
LOW_COUNT=$((LOW_COUNT + ${LOW:-0}))
TOTAL_COUNT=$((TOTAL_COUNT + ${TOT:-0}))
done
fi
WARN_COUNT=$(( TOTAL_COUNT > RESULT_COUNT ? TOTAL_COUNT - RESULT_COUNT : 0 ))
echo "Found $RESULT_COUNT high/critical, $MEDIUM_COUNT medium, $LOW_COUNT low, and $WARN_COUNT other CodeQL result(s)"
echo "codeql_errors=$RESULT_COUNT" >> "$GITHUB_OUTPUT"
echo "codeql_warnings=$WARN_COUNT" >> "$GITHUB_OUTPUT"
echo "codeql_mediums=$MEDIUM_COUNT" >> "$GITHUB_OUTPUT"
echo "codeql_lows=$LOW_COUNT" >> "$GITHUB_OUTPUT"
# Generate a findings detail file for inclusion in the PR comment
if [[ "$RESULT_COUNT" -gt 0 ]]; then
MERGE_SHA=$(git rev-parse HEAD)
{
echo "| Rule | Location | Description |"
echo "|------|----------|-------------|"
for f in sarif-results/*.sarif sarif-results/*.sarif.gz; do
[[ -f "$f" ]] || continue
if [[ "$f" == *.gz ]]; then
FC=$(gunzip -c "$f")
else
FC=$(cat "$f")
fi
echo "$FC" | jq -r \
--arg repo "$GITHUB_REPOSITORY" \
--arg sha "$MERGE_SHA" \
'.runs[] |
. as $run |
(
[ (($run.tool.driver.rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}),
((($run.tool.extensions // [])[].rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}) ]
| from_entries
) as $secmap |
($run.results // [])[] |
. as $result |
(($result.ruleId // $result.rule.id // "") | tostring) as $rid |
select((($secmap[$rid] // "0") | tonumber) >= 7.0) |
(.locations[0].physicalLocation.artifactLocation.uri // "?") as $uri |
((.locations[0].physicalLocation.region.startLine // "?") | tostring) as $line |
(.message.text // "no description" | gsub("\n"; " ") | gsub("://"; "\u200b://") | gsub("www\\."; "www\u200b.") | gsub("#(?=[0-9])"; "#\u200b") | gsub("\\[(?<c>[^\\]]+)\\][(][0-9]+[)]"; .c) | gsub("\\["; "[") | gsub("\\]"; "]") | if length > 150 then .[0:150] + "\u2026" else . end) as $msg |
(if $uri != "?" and $line != "?" then "[\($uri):\($line)](https://github.com/\($repo)/blob/\($sha)/\($uri)#L\($line))" else "\($uri):\($line)" end) as $loc |
"| `\($rid)` | \($loc) | \($msg) |"'
done
} > codeql-findings.md
fi
# Generate medium findings detail file for informational display in the PR comment
if [[ "$MEDIUM_COUNT" -gt 0 ]]; then
MERGE_SHA=${MERGE_SHA:-$(git rev-parse HEAD)}
{
echo "| Rule | Location | Description |"
echo "|------|----------|-------------|"
for f in sarif-results/*.sarif sarif-results/*.sarif.gz; do
[[ -f "$f" ]] || continue
if [[ "$f" == *.gz ]]; then
FC=$(gunzip -c "$f")
else
FC=$(cat "$f")
fi
echo "$FC" | jq -r \
--arg repo "$GITHUB_REPOSITORY" \
--arg sha "$MERGE_SHA" \
'.runs[] |
. as $run |
(
[ (($run.tool.driver.rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}),
((($run.tool.extensions // [])[].rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}) ]
| from_entries
) as $secmap |
($run.results // [])[] |
. as $result |
(($result.ruleId // $result.rule.id // "") | tostring) as $rid |
(($secmap[$rid] // "0") | tonumber) as $sev |
select($sev >= 6.0 and $sev < 7.0) |
(.locations[0].physicalLocation.artifactLocation.uri // "?") as $uri |
((.locations[0].physicalLocation.region.startLine // "?") | tostring) as $line |
(.message.text // "no description" | gsub("\n"; " ") | gsub("://"; "\u200b://") | gsub("www\\."; "www\u200b.") | gsub("#(?=[0-9])"; "#\u200b") | gsub("\\[(?<c>[^\\]]+)\\][(][0-9]+[)]"; .c) | gsub("\\["; "[") | gsub("\\]"; "]") | if length > 150 then .[0:150] + "\u2026" else . end) as $msg |
(if $uri != "?" and $line != "?" then "[\($uri):\($line)](https://github.com/\($repo)/blob/\($sha)/\($uri)#L\($line))" else "\($uri):\($line)" end) as $loc |
"| `\($rid)` | \($loc) | \($msg) |"'
done
} > codeql-medium-findings.md
fi
# Generate low findings detail file for informational display in the PR comment (collapsed)
if [[ "$LOW_COUNT" -gt 0 ]]; then
MERGE_SHA=${MERGE_SHA:-$(git rev-parse HEAD)}
{
echo "| Rule | Location | Description |"
echo "|------|----------|-------------|"
for f in sarif-results/*.sarif sarif-results/*.sarif.gz; do
[[ -f "$f" ]] || continue
if [[ "$f" == *.gz ]]; then
FC=$(gunzip -c "$f")
else
FC=$(cat "$f")
fi
echo "$FC" | jq -r \
--arg repo "$GITHUB_REPOSITORY" \
--arg sha "$MERGE_SHA" \
'.runs[] |
. as $run |
(
[ (($run.tool.driver.rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}),
((($run.tool.extensions // [])[].rules // [])[] | {key: (.id // ""), value: ((.properties["security-severity"] // "0") | tostring)}) ]
| from_entries
) as $secmap |
($run.results // [])[] |
. as $result |
(($result.ruleId // $result.rule.id // "") | tostring) as $rid |
(($secmap[$rid] // "0") | tonumber) as $sev |
select($sev < 6.0) |
(.locations[0].physicalLocation.artifactLocation.uri // "?") as $uri |
((.locations[0].physicalLocation.region.startLine // "?") | tostring) as $line |
(.message.text // "no description" | gsub("\n"; " ") | gsub("://"; "\u200b://") | gsub("www\\."; "www\u200b.") | gsub("#(?=[0-9])"; "#\u200b") | gsub("\\[(?<c>[^\\]]+)\\][(][0-9]+[)]"; .c) | gsub("\\["; "[") | gsub("\\]"; "]") | if length > 150 then .[0:150] + "\u2026" else . end) as $msg |
(if $uri != "?" and $line != "?" then "[\($uri):\($line)](https://github.com/\($repo)/blob/\($sha)/\($uri)#L\($line))" else "\($uri):\($line)" end) as $loc |
"| `\($rid)` | \($loc) | \($msg) |"'
done
} > codeql-low-findings.md
fi
if [[ "$RESULT_COUNT" -gt 0 || ( "${{ steps.detect-langs.outputs.found }}" == 'true' && "${{ steps.analyze.outcome }}" != "success" && "${{ steps.analyze.outcome }}" != "" ) ]]; then
echo "codeql_status=failure" >> "$GITHUB_OUTPUT"
elif [[ "${{ steps.detect-langs.outputs.found }}" == 'false' ]]; then
echo "codeql_status=skipped" >> "$GITHUB_OUTPUT"
else
echo "codeql_status=success" >> "$GITHUB_OUTPUT"
fi
echo "codeql_unscanned_langs=${{ steps.detect-langs.outputs.unscanned_langs }}" >> "$GITHUB_OUTPUT"
- name: Upload findings detail for PR comment
if: always() && steps.status.outputs.codeql_status == 'failure'
uses: actions/upload-artifact@v4
with:
name: codeql-findings
path: codeql-findings.md
if-no-files-found: ignore
- name: Upload medium findings detail for PR comment
if: always()
uses: actions/upload-artifact@v4
with:
name: codeql-medium-findings
path: codeql-medium-findings.md
if-no-files-found: ignore
- name: Upload low findings detail for PR comment
if: always()
uses: actions/upload-artifact@v4
with:
name: codeql-low-findings
path: codeql-low-findings.md
if-no-files-found: ignore
- name: Fail job if CodeQL found high/error/critical issues
if: always() && steps.status.outputs.codeql_status == 'failure'
run: exit 1
# --------------------------------------------------------------------------
# Job 6: ClamAV antivirus scan (runs after validate-plugin)
# --------------------------------------------------------------------------
clamav-scan:
needs: [detect-changes, validate-plugin, validate-title]
if: needs.validate-plugin.result == 'success' && needs.detect-changes.outputs.skip_validation != 'true' && needs.validate-title.outputs.title_valid == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
clamav_status: ${{ steps.status.outputs.clamav_status }}
clamav_infected: ${{ steps.status.outputs.clamav_infected }}
steps:
- name: Checkout PR merge commit for scan
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
sparse-checkout: .gitignore
sparse-checkout-cone-mode: false
- name: Limit checkout to changed plugin folders only
run: |
echo '${{ needs.detect-changes.outputs.matrix }}' \
| jq -r '.[] | "plugins/\(.)"' \
| git sparse-checkout set --stdin
git checkout
- name: Get cache keys
id: cache-keys
run: |
echo "week=$(date +%Y-W%V)" >> $GITHUB_OUTPUT
echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: Cache ClamAV installation (weekly)
id: cache-clamav-install
uses: actions/cache@v4
with:
path: /tmp/clamav-apt
key: clamav-install-${{ runner.os }}-${{ steps.cache-keys.outputs.week }}
restore-keys: clamav-install-${{ runner.os }}-
- name: Cache ClamAV virus definitions (daily)
id: cache-clamav-defs
uses: actions/cache@v4
with:
path: /tmp/clamav-db
key: clamav-defs-${{ runner.os }}-${{ steps.cache-keys.outputs.date }}
restore-keys: clamav-defs-${{ runner.os }}-
- name: Install ClamAV
run: |
sudo apt-get update -qq
if [[ "${{ steps.cache-clamav-install.outputs.cache-hit }}" == 'true' ]]; then
echo "Installing ClamAV from cached packages..."
sudo cp /tmp/clamav-apt/*.deb /var/cache/apt/archives/ 2>/dev/null || true
fi
sudo apt-get install -y --no-install-recommends clamav
if [[ "${{ steps.cache-clamav-install.outputs.cache-hit }}" != 'true' ]]; then
echo "Saving ClamAV packages to cache..."
mkdir -p /tmp/clamav-apt
find /var/cache/apt/archives/ \( -name 'clamav*.deb' -o -name 'libclamav*.deb' \) \
-exec cp {} /tmp/clamav-apt/ \; 2>/dev/null || true
fi
- name: Update virus definitions
run: |
sudo systemctl stop clamav-freshclam 2>/dev/null || true
sudo mkdir -p /tmp/clamav-db
sudo chown -R clamav:clamav /tmp/clamav-db
if [[ "${{ steps.cache-clamav-defs.outputs.cache-hit }}" != 'true' ]]; then
echo "Downloading fresh ClamAV definitions..."
sudo freshclam --datadir=/tmp/clamav-db
else
echo "Using cached ClamAV definitions"
fi
- name: Scan changed plugin directories
id: scan
run: |
PLUGIN_DIRS=$(echo '${{ needs.detect-changes.outputs.matrix }}' \
| jq -r '.[] | "plugins/\(.)"' | tr '\n' ' ')
echo "Scanning: $PLUGIN_DIRS"
set +e
# SC2086: PLUGIN_DIRS is intentionally word-split to produce multiple args
# shellcheck disable=SC2086
clamscan --database=/tmp/clamav-db \
--recursive --infected --no-summary \
$PLUGIN_DIRS > clamav-output.txt 2>&1
echo "exit_code=$?" >> $GITHUB_OUTPUT
set -e
cat clamav-output.txt
- name: Set ClamAV status outputs
id: status
if: always()
env:
SCAN_EXIT: ${{ steps.scan.outputs.exit_code }}
run: |
INFECTED=0
if [[ -f "clamav-output.txt" ]]; then
INFECTED=$(grep -c ' FOUND$' clamav-output.txt || true)
fi
echo "clamav_infected=$INFECTED" >> "$GITHUB_OUTPUT"
if [[ "$INFECTED" -gt 0 ]]; then
{
echo "| File | Signature |"
echo "|------|-----------|"
grep ' FOUND$' clamav-output.txt | while IFS= read -r line; do
FULL_PATH=$(echo "$line" | sed 's/: .* FOUND$//')
FILE=$(echo "$FULL_PATH" | sed "s|^${GITHUB_WORKSPACE}/||")
SIG=$(echo "$line" | sed 's/^[^:]*: //; s/ FOUND$//')
HASH=$(sha256sum "$FULL_PATH" 2>/dev/null | cut -d' ' -f1 || true)
if [[ -n "$HASH" ]]; then
echo "| \`$FILE\` | [\`$SIG\`](https://www.virustotal.com/gui/file/${HASH}) |"
else
echo "| \`$FILE\` | \`$SIG\` |"
fi
done
} > clamav-findings.md
echo "clamav_status=failure" >> "$GITHUB_OUTPUT"
elif [[ "${SCAN_EXIT:-0}" -ge 2 ]]; then
echo "clamav_status=failure" >> "$GITHUB_OUTPUT"
else
echo "clamav_status=success" >> "$GITHUB_OUTPUT"
fi
- name: Upload ClamAV findings for PR comment
if: always() && steps.status.outputs.clamav_status == 'failure'
uses: actions/upload-artifact@v4
with:
name: clamav-findings
path: clamav-findings.md
if-no-files-found: ignore
- name: Load app ID from config
if: always() && steps.status.outputs.clamav_status == 'failure'
id: config
env:
GH_APP_ID: ${{ vars.GH_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
run: |
if [[ -n "${GH_APP_ID:-}" && -n "${GH_APP_PRIVATE_KEY:-}" ]]; then
echo "app_id=${GH_APP_ID}" >> "$GITHUB_OUTPUT"
echo "use_app=true" >> "$GITHUB_OUTPUT"
else
echo "use_app=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate GitHub App token
if: always() && steps.status.outputs.clamav_status == 'failure' && steps.config.outputs.use_app == 'true'
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ steps.config.outputs.app_id }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Apply quarantine label
if: always() && steps.status.outputs.clamav_status == 'failure'
env:
GH_TOKEN: ${{ steps.config.outputs.use_app == 'true' && steps.app-token.outputs.token || github.token }}
run: |
gh label create "QUARANTINE" \
--color "FFFF00" \
--description "ClamAV detected a potential threat in this PR" \
--repo "$GITHUB_REPOSITORY" 2>/dev/null || true
gh pr edit "${{ github.event.pull_request.number }}" \
--add-label "QUARANTINE" \
--repo "$GITHUB_REPOSITORY"
- name: Fail job if ClamAV detected threats
if: always() && steps.status.outputs.clamav_status == 'failure'
run: exit 1
# --------------------------------------------------------------------------
# Job 7: Validate each plugin in parallel via matrix
# --------------------------------------------------------------------------
validate-plugin:
needs: [detect-changes]
if: needs.detect-changes.outputs.close_pr == 'false' && needs.detect-changes.outputs.skip_validation != 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
plugin: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
steps:
- name: Checkout base branch scripts (trusted)
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
- name: Fetch base branch
run: git fetch origin ${{ github.event.pull_request.base.ref }}
- name: Save trusted scripts before fork checkout
run: cp -r .github/scripts /tmp/trusted-scripts
- name: Checkout PR plugins (untrusted content only)
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
sparse-checkout: plugins
sparse-checkout-cone-mode: false
clean: false
- name: Restore trusted scripts
run: mkdir -p .github && cp -r /tmp/trusted-scripts .github/scripts
- name: Re-fetch base branch refs
run: git fetch https://github.com/${{ github.repository }} +${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
- name: Load app ID from config
id: config
env:
GH_APP_ID: ${{ vars.GH_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
run: |
if [[ -n "${GH_APP_ID:-}" && -n "${GH_APP_PRIVATE_KEY:-}" ]]; then
echo "app_id=${GH_APP_ID}" >> "$GITHUB_OUTPUT"
echo "use_app=true" >> "$GITHUB_OUTPUT"
else
echo "use_app=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate GitHub App token
if: steps.config.outputs.use_app == 'true'
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ steps.config.outputs.app_id }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Log fallback to actions token
if: steps.config.outputs.use_app != 'true'
run: |
printf '## ⚠️ GitHub App token not available\n\nGH_APP_ID or GH_APP_PRIVATE_KEY not configured. Falling back to `GITHUB_TOKEN` (github-actions[bot] identity).\n' >> "$GITHUB_STEP_SUMMARY"
- name: Validate ${{ matrix.plugin }}
id: validate
env:
GH_TOKEN: ${{ steps.config.outputs.use_app == 'true' && steps.app-token.outputs.token || github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
chmod +x .github/scripts/validate/*.sh
set +e
.github/scripts/validate/validate.sh \
"${{ matrix.plugin }}" \