File change
Goal
Run a workflow whenever a particular file in your project changes. Time: 10 minutes.
Rules
- Termorq watches inside the workflow
folder, and refuses a path outside it. - Changes are debounced (by 1.5 seconds by default), so a burst of saves starts one run.
pathmatches the changed file’s path relative to the folder (or a trailing part of it). If you leavepathempty, any change in the folder triggers a run.- The trigger provides
trigger.pathandtrigger.received_at.
Warning
Don’t write files into the watched folder from the same workflow, or each run will trigger the next one. Write artifacts to $TERMORQ_OUTPUT instead.
Check your run
Run touch ~/src/acme-apis/config/app.json. One run starts, and line names the file.
Exercise
Make the block validate that the changed file is still valid JSON, and publish valid: boolean.