Skip to content

Add GitHub Actions workflow and scripts for Markdown to PDF conversion - #4

Merged
alexanderoster merged 2 commits into
masterfrom
markdown2pdf
Sep 24, 2026
Merged

alexanderoster merged 2 commits into
masterfrom
markdown2pdf

Conversation

@3dJan

@3dJan 3dJan commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical script execution issues and additional conversion reliability concerns must be addressed.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds GitHub Actions automation and scripts to convert Markdown specifications into a downloadable PDF.

Changes:

  • Adds print-specific CSS.
  • Adds Markdown-to-PDF and wkhtmltopdf installation scripts.
  • Adds a workflow to build and upload the PDF artifact.
File summaries
File Summary
markdownToPDF/print.css Adds print layout styling.
markdownToPDF/mdToPDF.sh Critical shebang issue (1 vote); moderate error handling, temporary-file, viewport, and API credential concerns.
markdownToPDF/install_wkhtmltopdf.sh Critical shebang issue (1 vote).
.github/workflows/build.yml Critical direct-execution/shebang issue affecting both scripts (1 vote).
Review details

Suppressed comments (3)

markdownToPDF/mdToPDF.sh:76

  • The 1280px viewport is wider than the printable width of an A4 page with these margins, and --disable-smart-shrinking prevents wkhtmltopdf from scaling it down. The full-width rules will therefore clip the right side of the document rather than fixing the reported clipping; use a viewport matching the printable width or allow smart shrinking.
	--viewport-size 1280x2000 \
		--dpi 96 \
		--disable-smart-shrinking \

markdownToPDF/mdToPDF.sh:30

  • A fixed temp.html is shared by every invocation, so concurrent conversions can overwrite one another and produce a PDF from the wrong document. Allocate a unique temporary file (and clean it up on exit) instead.
TMPFILE="temp.html"

markdownToPDF/mdToPDF.sh:27

  • The workflow never sets GITHUB_API_KEY, so this always configures Grip with an empty credential. grip --export then relies on unauthenticated GitHub API requests, making repeated PR builds vulnerable to rate-limit failures; pass the workflow's read-only token to the script or use a rendering path that does not require the API.
echo "PASSWORD = '${GITHUB_API_KEY}'" > ~/.grip/settings.py
  • Files reviewed: 4/4 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +20 to +21
- run: ./markdownToPDF/install_wkhtmltopdf.sh
- run: ./markdownToPDF/mdToPDF.sh "$SPECNAME"
Comment on lines +1 to +3
# Copyright (c) 2019 3MF Consortium
# All rights reserved.

Comment thread markdownToPDF/mdToPDF.sh
Comment on lines +1 to +3
# Copyright (c) 2019 3MF Consortium
# All rights reserved.

Comment thread markdownToPDF/mdToPDF.sh
Comment on lines +26 to +32
mkdir -p ~/.grip
echo "PASSWORD = '${GITHUB_API_KEY}'" > ~/.grip/settings.py

FILE="$1"
TMPFILE="temp.html"

grip "$FILE.md" --export "$FILE.html"
@alexanderoster
alexanderoster merged commit fe99fe2 into master Sep 24, 2026
1 check passed
@3dJan
3dJan deleted the markdown2pdf branch September 24, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants