File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 3030 else
3131 echo "No Mermaid diagrams to validate"
3232 fi
33+ env :
34+ PUPPETEER_CONFIG : ${{ github.workspace }}/scripts/puppeteer-config.json
3335
3436 lint-markdown :
3537 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1+ {
2+ "args" : [" --no-sandbox" , " --disable-setuid-sandbox" ]
3+ }
Original file line number Diff line number Diff line change 2424 MMDC_AVAILABLE=true
2525fi
2626
27+ MMDC_ARGS=" "
28+ if [[ -n " $PUPPETEER_CONFIG " ]] && [[ -f " $PUPPETEER_CONFIG " ]]; then
29+ MMDC_ARGS=" -p $PUPPETEER_CONFIG "
30+ echo " Using Puppeteer config: $PUPPETEER_CONFIG "
31+ elif [[ -f " $SCRIPT_DIR /puppeteer-config.json" ]]; then
32+ MMDC_ARGS=" -p $SCRIPT_DIR /puppeteer-config.json"
33+ echo " Using Puppeteer config: $SCRIPT_DIR /puppeteer-config.json"
34+ fi
35+
2736ERRORS=0
2837TOTAL=0
2938
@@ -55,7 +64,7 @@ validate_markdown_file() {
5564 echo " $mermaid_content " > " $temp_file "
5665
5766 if [[ " $MMDC_AVAILABLE " == true ]]; then
58- if mmdc -i " $temp_file " -o " $TEMP_DIR /output.svg" 2> " $TEMP_DIR /error.log" ; then
67+ if mmdc $MMDC_ARGS -i " $temp_file " -o " $TEMP_DIR /output.svg" 2> " $TEMP_DIR /error.log" ; then
5968 echo -e " ${GREEN} ✓${NC} $file :$block_start_line (block $block_num )"
6069 else
6170 echo -e " ${RED} ✗${NC} $file :$block_start_line (block $block_num )"
91100 for file in $MMD_FILES ; do
92101 TOTAL=$(( TOTAL + 1 ))
93102 if [[ " $MMDC_AVAILABLE " == true ]]; then
94- if mmdc -i " $file " -o " $TEMP_DIR /output.svg" 2> " $TEMP_DIR /error.log" ; then
103+ if mmdc $MMDC_ARGS -i " $file " -o " $TEMP_DIR /output.svg" 2> " $TEMP_DIR /error.log" ; then
95104 echo -e " ${GREEN} ✓${NC} $file "
96105 else
97106 echo -e " ${RED} ✗${NC} $file "
You can’t perform that action at this time.
0 commit comments