Skip to content

Commit 1760fb3

Browse files
authored
Update code-quality.yml
1 parent ceb8c30 commit 1760fb3

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

.github/workflows/code-quality.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code Quality SlizR
1+
name: Code Quality
22

33
on:
44
push:
@@ -23,43 +23,33 @@ jobs:
2323
sudo apt-get update
2424
sudo apt-get install -y shellcheck
2525
26-
- name: Shell check
27-
id: shell
26+
- name: Shell analysis
2827
run: |
29-
find . -type f -name "*.sh" -print0 | xargs -0 -r shellcheck || true
28+
find . -type f -name "*.sh" -exec shellcheck {} + || true
3029
31-
- name: VBScript check
32-
id: vbs
30+
- name: VBScript analysis
3331
run: |
34-
find . -type f -name "*.vbs" -print0 | while read f; do
35-
grep -qE '^(Option Explicit|Dim |Set )' "$f" || echo "Structure issue in $f"
36-
done || true
32+
find . -type f -name "*.vbs" -exec grep -L "Option Explicit" {} + || true
3733
38-
- name: Prepare report
34+
- name: Generate report
3935
id: report
4036
run: |
41-
ERRORS=$( (find . -name "*.sh" -exec shellcheck {} +; find . -name "*.vbs" -exec grep -L "Option Explicit" {} +) 2>/dev/null | wc -l )
42-
if [ "$ERRORS" -eq 0 ]; then
43-
echo "status=ok" >> $GITHUB_OUTPUT
44-
echo "message=All checks passed" >> $GITHUB_OUTPUT
37+
SH_ERRORS=$(find . -name "*.sh" -exec shellcheck {} + 2>/dev/null | wc -l)
38+
VBS_ERRORS=$(find . -name "*.vbs" -exec grep -L "Option Explicit" {} + 2>/dev/null | wc -l)
39+
TOTAL=$((SH_ERRORS + VBS_ERRORS))
40+
if [ "$TOTAL" -eq 0 ]; then
41+
echo "body=All checks passed" >> $GITHUB_OUTPUT
4542
else
46-
echo "status=fail" >> $GITHUB_OUTPUT
47-
echo "message=Code issues detected: $ERRORS problems found" >> $GITHUB_OUTPUT
43+
echo "body=Code issues detected. Shell issues: $SH_ERRORS. VBScript issues: $VBS_ERRORS." >> $GITHUB_OUTPUT
4844
fi
4945
5046
- name: Create Pull Request
5147
uses: peter-evans/create-pull-request@v6
5248
with:
53-
commit-message: Code Quality Check
54-
title: Code Quality Report
55-
body: ${{ steps.report.outputs.message }}
49+
commit-message: Code Quality Report
50+
title: Code Quality
51+
body: ${{ steps.report.outputs.body }}
5652
branch: code-quality-report
5753
base: main
5854
add-paths: |
5955
nil/**
60-
61-
- name: Comment result
62-
uses: peter-evans/create-or-update-comment@v4
63-
with:
64-
issue-number: ${{ github.event.pull_request.number }}
65-
body: ${{ steps.report.outputs.message }}

0 commit comments

Comments
 (0)