Skip to content

Commit 1e123cf

Browse files
authored
feat: add ZIZMOR_CONFIG (#789)
1 parent de2e68f commit 1e123cf

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

docs/release-notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ of `zizmor`.
2222
will redirect to the new one, but users should update any old
2323
links to limit confusion
2424

25+
### New Features 🌈
26+
27+
* `zizmor` now supports the `ZIZMOR_CONFIG` environment variable as an
28+
alternative to `--config` (#789)
29+
2530
## v1.7.0
2631

2732
This release comes with **four** new audits: [obfuscation], [stale-action-refs],

docs/snippets/help.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Options:
2929
--color <MODE>
3030
Control the use of color in output [possible values: auto, always, never]
3131
-c, --config <CONFIG>
32-
The configuration file to load. By default, any config will be discovered relative to $CWD
32+
The configuration file to load. By default, any config will be discovered relative to $CWD [env: ZIZMOR_CONFIG=]
3333
--no-config
3434
Disable all configuration loading
3535
--no-exit-codes

docs/usage.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,14 @@ the `--config` argument. With `--config`, the file can be named anything:
502502
zizmor --config my-zizmor-config.yml /dir/to/audit
503503
```
504504

505+
!!! tip
506+
507+
Starting with `v1.8.0`, you can use the `ZIZMOR_CONFIG` environment
508+
variable to specify a configuration file.
509+
510+
`ZIZMOR_CONFIG=my-config.yml` is equivalent to
511+
`--config my-config.yml`.
512+
505513
[will discover it]: ./configuration.md#precedence
506514

507515
See [Configuration: `rules.<id>.ignore`](./configuration.md#rulesidignore) for

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct App {
8989

9090
/// The configuration file to load. By default, any config will be
9191
/// discovered relative to $CWD.
92-
#[arg(short, long, group = "conf")]
92+
#[arg(short, long, env = "ZIZMOR_CONFIG", group = "conf")]
9393
config: Option<Utf8PathBuf>,
9494

9595
/// Disable all configuration loading.

0 commit comments

Comments
 (0)