A reusable GitHub Action that executes a bash script inside a container with the current working directory (CWD) mounted. This action simplifies workflows by enabling script execution in an isolated containerized environment while maintaining access to the local project files
This action provides an alternative for using the container: directive, which runs an entire job inside a container.
This allows running actions/checkout, actions/download-artifact, actions/upload-artifact, and other actions outside of the container's context,
avoid conflicts with the container's environment, and allows for a more flexible and modular workflow.
steps:
- name: Checkout Foo repositoryuses: actions/checkout@v4
- name: Build inside of containeruses: RedisLabsModules/run-containerized-script@v1with:
image: docker.io/foo/foo-container:x.y.zargs: | echo "::group::Building Foo" cd foo-folder make echo "::endgroup::" tar -czf foo-artifacts.tar.gz - name: Upload Foo artifactuses: actions/upload-artifact@v4with:
name: foo-artifactspath: | foo-folder/foo-artifacts.tar.gzThe following inputs can be used as step.with keys:
| Name | Type | Description |
|---|---|---|
image | String | The container image to use. |
args | String | The script to invoke inside of the container. |