-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.7 KB
/
Copy pathexample-advanced.yml
File metadata and controls
56 lines (47 loc) · 1.7 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
# Example: Advanced CI/CD with Outputs
name: Advanced Code Quality Pipeline
# This example is workflow_dispatch-only to avoid running in this repository.
# Copy into your project and adjust triggers as needed.
on:
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
health-check:
name: Code Health Analysis
runs-on: ubuntu-latest
outputs:
grade: ${{ steps.devscope.outputs.grade }}
risk: ${{ steps.devscope.outputs.risk }}
health: ${{ steps.devscope.outputs.health }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Devscope
id: devscope
uses: EhsanAzish80/devscope-action@v1
with:
fail-under: B
max-risk: Medium
max-onboarding: Moderate
- name: Report metrics
run: |
echo "### 📊 Code Health Metrics" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Grade:** ${{ steps.devscope.outputs.grade }}" >> $GITHUB_STEP_SUMMARY
echo "- **Risk:** ${{ steps.devscope.outputs.risk }}" >> $GITHUB_STEP_SUMMARY
echo "- **Onboarding:** ${{ steps.devscope.outputs.onboarding }}" >> $GITHUB_STEP_SUMMARY
echo "- **Health Score:** ${{ steps.devscope.outputs.health }}/100" >> $GITHUB_STEP_SUMMARY
notify:
name: Notify on Grade Change
needs: health-check
runs-on: ubuntu-latest
if: needs.health-check.outputs.grade == 'F'
steps:
- name: Alert on critical health
run: |
echo "::error::Code health is critical (Grade: F)"
echo "Immediate action required to improve maintainability"