Add some more details to the docs about environment variables

This commit is contained in:
莯凛 2025-01-21 03:53:25 +08:00 committed by Dave Rolsky
parent 02bec77bb9
commit 5b5d0b578b

View File

@ -84,7 +84,8 @@ This action takes the following parameters:
### Setting Environment Variables
You can simply set an `env` key in the workflow step that uses this action, for example:
By default, `cross` passes most rust-related environment variables through when it runs `cargo` in a
Docker image. This means you can simply set an `env` key in the workflow step that uses this action.
```
- name: Run build command
@ -96,6 +97,11 @@ You can simply set an `env` key in the workflow step that uses this action, for
command: build
```
If you want to pass other environment variables through, you will need to configure `cross` to do
see. See the
[`cross` docs](https://github.com/cross-rs/cross/blob/main/docs/environment_variables.md#environment-variable-passthrough)
for more details.
## How it Works
Under the hood, this action will compile your binaries with either `cargo` or `cross`, depending on