From 61a18512c17011bc02da5c29b6702761150fd48a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 31 Jan 2026 04:55:24 +0000 Subject: [PATCH] Allow enabling verbose mode via JOSH_SYNC_VERBOSE Make it easier to print verbose messages when using the action without needing a way to set per-command CLI arguments. --- Cargo.toml | 2 +- README.md | 4 ++++ src/bin/rustc_josh_sync.rs | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4b11d4d..7ad5c90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ name = "rustc-josh-sync" [dependencies] anyhow = "1" -clap = { version = "4", features = ["derive"] } +clap = { version = "4", features = ["derive", "env"] } directories = "6" toml = "0.8" serde = { version = "1", features = ["derive"] } diff --git a/README.md b/README.md index 94ad9ec..4f2332f 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,10 @@ on: # Run at 04:00 UTC every Monday and Thursday - cron: '0 4 * * 1,4' +env: + # Optional to print detailed command logs + JOSH_SYNC_VERBOSE: true + jobs: pull: uses: rust-lang/josh-sync/.github/workflows/rustc-pull.yml@main diff --git a/src/bin/rustc_josh_sync.rs b/src/bin/rustc_josh_sync.rs index ff3794a..2c8a05a 100644 --- a/src/bin/rustc_josh_sync.rs +++ b/src/bin/rustc_josh_sync.rs @@ -50,7 +50,7 @@ enum Command { allow_noop: bool, /// Print executed commands. - #[clap(long, short = 'v')] + #[clap(long, short = 'v', env = "JOSH_SYNC_VERBOSE")] verbose: bool, }, /// Push changes into the main `rust-lang/rust` repository `branch` of a `rustc` fork under @@ -72,7 +72,7 @@ enum Command { username: String, /// Print executed commands. - #[clap(long, short = 'v')] + #[clap(long, short = 'v', env = "JOSH_SYNC_VERBOSE")] verbose: bool, }, }