hive-forge: print the ref ci-runs --branch resolved to
qualify_ref (ci_runs.rs:84-93) reads '#N' and an all-digit value as a PR, anything else as a branch — so '--branch #4540' and '--branch ops-4502-swarm-agent-icon' for the same PR/head commit answer two disjoint questions with no indication which one was asked. Print the resolved ref to stderr whenever --branch is given, so the output states which question it answered. Stdout is untouched in both plain and --json mode, so no existing invocation's parsed output changes. An all-digit branch name stays reachable via --branch refs/heads/<name> (already documented, unchanged).
This commit is contained in:
parent
7d2660fe75
commit
8e6c813325
1 changed files with 5 additions and 1 deletions
|
|
@ -41,9 +41,13 @@ pub struct Args {
|
||||||
/// Returns an error if the list request fails (network, or a non-2xx).
|
/// Returns an error if the list request fails (network, or a non-2xx).
|
||||||
pub fn run(client: &Client, args: Args) -> Result<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let (owner, name) = client.owner_repo()?;
|
let (owner, name) = client.owner_repo()?;
|
||||||
|
let qualified_ref = args.branch.as_deref().map(qualify_ref);
|
||||||
|
if let (Some(given), Some(resolved)) = (args.branch.as_deref(), qualified_ref.as_deref()) {
|
||||||
|
eprintln!("hive-forge: --branch {given:?} -> {resolved}");
|
||||||
|
}
|
||||||
let query = ListActionRunsQuery {
|
let query = ListActionRunsQuery {
|
||||||
workflow_id: args.workflow.clone(),
|
workflow_id: args.workflow.clone(),
|
||||||
r#ref: args.branch.as_deref().map(qualify_ref),
|
r#ref: qualified_ref,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let body = client
|
let body = client
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue