read-file
Learn how to read file content into a variable.
This action reads the content of a file and stores it in a variable.
The content is available as a string for use in subsequent actions, such as printing, patching, or conditional logic.
Example
The following template reads a file and prints its content:
template.json5
{ "$schema": "https://schema.croct.com/json/v1/template.json", "title": "File reader", "description": "Reads and displays a file.", "actions": [ { "name": "read-file", "path": "README.md", "result": "content" }, { "name": "print", "semantics": "info", "message": "${this.content}" } ]}To apply this template, run:
npm
npx croct@latest use template.json5Properties
These are the supported properties: