Skip to content

Commit f8042a4

Browse files
authored
Merge pull request #102 from JohT/fix/failing-reference-doc-generation-due-to-headerless-markdown-files
Ignore header-less Markdown files in reference generation
2 parents dd331df + d2f9fc7 commit f8042a4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/internal-report-reference-documentation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- "!analysis-results/*.md" # Ignore report reference documentation changes (endless loop prevention)
1010
- ".github/workflows/internal-report-reference-documentation.yml" # Also run when this file was changed
1111
- ".github/workflows/internal-commit-results" # Also run when the commit-results workflow was changed
12+
- "documentation/analysis-reports-reference/**" # Also run when the report reference generation scripts were changed
1213
pull_request:
1314
branches:
1415
- main
@@ -17,6 +18,7 @@ on:
1718
- "!analysis-results/*.md" # Ignore report reference documentation changes (endless loop prevention)
1819
- ".github/workflows/internal-report-reference-documentation.yml" # Also run when this file was changed
1920
- ".github/workflows/internal-commit-results" # Also run when the commit-results workflow was changed
21+
- "documentation/analysis-reports-reference/**" # Also run when the report reference generation scripts were changed
2022

2123
jobs:
2224
generate-report-reference-documentation:

documentation/analysis-reports-reference/generateJupyterReportReference.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ echo "generateJupyterReportReference: Generating ${markdown_file}..."
2424

2525
# Loop through all Markdown files in the current directory
2626
find . -type f -name "*.md" | sort | while read -r report_file; do
27-
# Extract the first non-empty line that starts with '#'
28-
report_file_header_line=$(grep -m 1 -e '^#\+.*' "${report_file}")
27+
# Extract the first non-empty line that starts with one or more '#', allowing leading spaces
28+
if ! report_file_header_line=$(grep -m 1 -e '^[[:space:]]*#\+[[:space:]]*.*' "${report_file}"); then
29+
echo "generateJupyterReportReference: Warning: No header line found in ${report_file}, skipping."
30+
continue
31+
fi
2932

3033
# Remove leading '#' characters and trim leading/trailing spaces
3134
description=$(echo "${report_file_header_line}" | sed -E 's/^#+\s*//')

0 commit comments

Comments
 (0)