-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
98 lines (81 loc) · 2.8 KB
/
Copy pathaction.yml
File metadata and controls
98 lines (81 loc) · 2.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
name: "MD Files Connector"
description: "Scans your project for Markdown files, checks root README coverage, outputs a dashboard, and generates MD_REPORT.md."
author: "md-connector"
branding:
icon: "file-text"
color: "blue"
inputs:
project-root:
description: "Root directory of the project to scan"
required: false
default: "."
exclude-dirs:
description: "Space-separated list of directory names to exclude"
required: false
default: "node_modules .git venv .venv __pycache__ dist build"
report-path:
description: "Path for the generated MD report file"
required: false
default: "MD_REPORT.md"
skip-report:
description: "Set to 'true' to skip generating MD_REPORT.md"
required: false
default: "false"
fail-on-isolated:
description: "Set to 'true' to exit with code 1 if any isolated MD files are found"
required: false
default: "false"
outputs:
total-md-files:
description: "Total number of MD files found (excluding README)"
value: ${{ steps.run-scanner.outputs.total }}
linked-files:
description: "Number of MD files linked in README"
value: ${{ steps.run-scanner.outputs.linked }}
isolated-files:
description: "Number of MD files NOT linked in README"
value: ${{ steps.run-scanner.outputs.isolated }}
coverage:
description: "Coverage percentage (linked / total * 100)"
value: ${{ steps.run-scanner.outputs.coverage }}
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
shell: bash
run: pip install rich
- name: Run MD Files Connector
id: run-scanner
shell: bash
run: |
EXCLUDE_ARGS=""
for dir in ${{ inputs.exclude-dirs }}; do
EXCLUDE_ARGS="$EXCLUDE_ARGS $dir"
done
REPORT_ARG=""
if [ "${{ inputs.skip-report }}" = "true" ]; then
REPORT_ARG="--no-report"
else
REPORT_ARG="--report ${{ inputs.report-path }}"
fi
python ${{ github.action_path }}/md_connector.py \
"${{ inputs.project-root }}" \
--exclude $EXCLUDE_ARGS \
$REPORT_ARG \
${{ inputs.fail-on-isolated == 'true' && '--fail-on-isolated' || '' }} 2>&1 | tee /tmp/md_connector_output.txt
# Parse outputs from a lightweight JSON sidecar
python ${{ github.action_path }}/md_connector_outputs.py \
"${{ inputs.project-root }}" \
--exclude $EXCLUDE_ARGS \
--report ${{ inputs.report-path }} >> $GITHUB_OUTPUT
- name: Upload MD Report as artifact
if: inputs.skip-report != 'true'
uses: actions/upload-artifact@v4
with:
name: md-connector-report
path: ${{ inputs.report-path }}
if-no-files-found: warn