Releases: html2img/action
Release list
v1.0.0
First release of the HTML to Image action.
Renders inline HTML, an HTML file in the workspace, a live URL or a named template to a PNG or a PDF, on the node20 runner with no container.
What it does
- Four sources, exactly one per step:
html,html-file,urlortemplatewithvariables. - Render options mirroring the API:
width,height,full-page,selector,wait-for-selector,ms-delay,dpi,css,formatandscale-to-fit. output-pathdownloads the render into the workspace, creating parent directories.skip-unchanged, on by default, hashes the resolved inputs and records the digest in a.html2img-hashsidecar. When the file and a matching digest are both present the API is not called, so an unchanged render costs no credit.- Outputs:
url,pathandskipped.
Options the API documents as ignored for a given render are dropped with a warning naming them, which keeps the request body and the cache digest in step.
Errors
Failures name the cause and the fix. An invalid key points at the dashboard, running out of credits points at pricing, and a rejected parameter carries the API's own message for that field. Neither the API key nor the rendered HTML is written to the log.
Usage
- uses: html2img/action@v1
with:
api-key: ${{ secrets.HTML2IMG_API_KEY }}
html: '<div style="font: 700 72px system-ui; padding: 80px">Hello</div>'
width: 1200
height: 630
output-path: og/hello.png
See the README for three complete workflows: Open Graph images at build time, a pull request preview screenshot posted as a comment, and a social card on release.