Integration
Formfeed for GitHub Actions
Templates kept as files in a repository deserve the care code gets: a pull request that breaks one should fail before it is merged, and a reviewer should see the document, not a diff of its HTML. The action runs Formfeed’s command line in your workflow and does both, then publishes from your default branch.
In GitHub’s Marketplace as Formfeed templates (formfeed-dev/formfeed-action).
Free plan with 100 units a month, no credit card
One step in your workflow
Add the action to a workflow that runs on pull requests and on pushes to your default branch. With a test key it renders the previews for free, and a second step with a live key publishes. The documentation has the whole workflow and every input, and GitHub lists the action on its Marketplace page.
steps:
- uses: actions/checkout@v4
- uses: formfeed-dev/formfeed-action@v1
with:
api-key: ${{ secrets.FORMFEED_TEST_KEY }}
- if: github.event_name == 'push'
uses: formfeed-dev/formfeed-action@v1
with:
api-key: ${{ secrets.FORMFEED_LIVE_KEY }}
validate: false
test: false
publish: trueWhat every run does
- Validates every template: its syntax, variables its default data set does not have, header and footer, partials the project lacks, and for an invoice template the
_invoiceblock of every data set. Offline, without a key. - Tests every data set against its approved snapshot, so a change to a shared partial or a style that moves another template shows up as a failed check.
- Renders the templates a pull request changes through the API (every template when a partial changed), uploads the files as an artifact and keeps one comment on the pull request with the page count of every document.
- Publishes a new version of every template of the project on the default branch, or pushes to a release channel to try a change before it goes live.
Worth knowing before you add it
- Use a test key for pull requests: its renders cost nothing and its files are deleted after a day. The publish step needs a key with
template:writeand no more. - The comment needs
pull-requests: writein the job’s permissions; without it the action warns, and the previews are still in the artifact. - Pull requests from forks run without your secrets, so they are validated and tested but not previewed.
- The action runs the published
formfeedcommand line; its inputversionpins the one you tested.