feat: add ZIZMOR_CONFIG (#789)

This commit is contained in:
William Woodruff 2025-05-12 16:33:16 -04:00 committed by GitHub
parent de2e68f63c
commit 1e123cfbe5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 2 deletions

View file

@ -22,6 +22,11 @@ of `zizmor`.
will redirect to the new one, but users should update any old
links to limit confusion
### New Features 🌈
* `zizmor` now supports the `ZIZMOR_CONFIG` environment variable as an
alternative to `--config` (#789)
## v1.7.0
This release comes with **four** new audits: [obfuscation], [stale-action-refs],

View file

@ -29,7 +29,7 @@ Options:
--color <MODE>
Control the use of color in output [possible values: auto, always, never]
-c, --config <CONFIG>
The configuration file to load. By default, any config will be discovered relative to $CWD
The configuration file to load. By default, any config will be discovered relative to $CWD [env: ZIZMOR_CONFIG=]
--no-config
Disable all configuration loading
--no-exit-codes

View file

@ -502,6 +502,14 @@ the `--config` argument. With `--config`, the file can be named anything:
zizmor --config my-zizmor-config.yml /dir/to/audit
```
!!! tip
Starting with `v1.8.0`, you can use the `ZIZMOR_CONFIG` environment
variable to specify a configuration file.
`ZIZMOR_CONFIG=my-config.yml` is equivalent to
`--config my-config.yml`.
[will discover it]: ./configuration.md#precedence
See [Configuration: `rules.<id>.ignore`](./configuration.md#rulesidignore) for

View file

@ -89,7 +89,7 @@ struct App {
/// The configuration file to load. By default, any config will be
/// discovered relative to $CWD.
#[arg(short, long, group = "conf")]
#[arg(short, long, env = "ZIZMOR_CONFIG", group = "conf")]
config: Option<Utf8PathBuf>,
/// Disable all configuration loading.