Running Additional Commands

Actions run inside Python slim containers. To add extra bash scripts to be executed in the container, create any of the following files in the action's root path and include the scripts there.

  • pre-script.sh: runs before the action dependencies installation.

  • post-script.sh: runs after the action dependencies installation.

For instance, if your action has a dependency on a GitHub repository like this:

[project]
...
dependencies = [
    ...
    "pydantic @ git+https://github.com/pydantic/pydantic#main"
]

You need to install git before installing the action dependencies. Create the pre-script.sh file and add the following script to it.

apt update
apt install -y git

It will install git before installing your action dependencies.

Updated on