An Actionfile is a special Markdown-based configuration file that describes a set of actions, scripts, or tasks for use in automation workflows, dotfile management, or application deployment. It is designed for human readability and machine parsing, combining documentation, configuration, and executable code blocks in one file.
An Actionfile is organized into sections with Markdown headers. Each section can contain:
- Introduction/Description:
General information about the action. - Config Block:
INI-style configuration, usually under a
### configheader and fenced in a code block. - Variables Block:
Shell variable assignments, under a
### varsheader and fenced in a code block. - Action Sections:
Individual actions, typically under
### {action-context}headers, containing documentation and executable code blocks.
The following has specific changes that I use for my own dotfiles
myapp.md
This Actionfile defines actions for installing and configuring MyApp.
[install]
user = "myuser"
path = "/opt/myapp"Note
These will be exported as INSTALL_USER, and INSTALL_PATH. This can be overriden by an .ini file on disk that is named like the Actionfile, but using the .ini-extension.
APP_VERSION="1.2.3"
COPFIG_REPO="..."shared_function() {
# ...
}
# other overridesInstalls MyApp to the configured path.
echo "Installing MyApp version $APP_VERSION to $INSTALL_PATH"
# installation script goes hereConfigures MyApp after installation.
echo "Configuring MyApp for user $INSTALL_USER"
# configuration script goes hereecho "Starts the application for $INSTALL_USER"
# ...| Section | Header Example | Purpose |
|---|---|---|
| Description | # ..., ## ... |
File-level docs |
| Config Block | ### config |
INI-style settings inside a fenced ini block |
| Vars Block | ### vars |
Shell variable assignments in a fenced sh block |
| Action | ### action |
Each action with docs and fenced sh code block |
- Config blocks (INI) are only parsed if under
### configand inside ainicode block. - Vars blocks are only parsed if under
### varsand inside ashcode block. - Actions are discovered by scanning for
###headers; code blocks under these are the scripts to run. - Comments and documentation outside code blocks are ignored by automation tools but helpful for users.