hive-forge: issue-create refuses an empty body
This commit is contained in:
parent
af3a9e5433
commit
3c4ff447e3
1 changed files with 13 additions and 5 deletions
|
|
@ -34,12 +34,20 @@ pub struct Args {
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// Propagates any I/O error from the body input (`--body-file`,
|
/// Propagates any I/O error from the body input (`--body-file`,
|
||||||
/// stdin), any transport error from the Forgejo REST call (network
|
/// stdin), an absent or whitespace-only body (an issue's body *is*
|
||||||
/// unreachable, 4xx/5xx response, token missing/invalid, the
|
/// the issue per this repo's contribution guidance — an empty one is
|
||||||
/// `--label` lookup's own list-labels call), an unresolved `--label`
|
/// never intentional, only ever the signature of a mistake upstream,
|
||||||
/// name, and any I/O error from writing the issue URL to stdout.
|
/// e.g. a heredoc that bound to the wrong command in a pipeline), any
|
||||||
|
/// transport error from the Forgejo REST call (network unreachable,
|
||||||
|
/// 4xx/5xx response, token missing/invalid, the `--label` lookup's
|
||||||
|
/// own list-labels call), an unresolved `--label` name, and any I/O
|
||||||
|
/// error from writing the issue URL to stdout.
|
||||||
pub fn run(client: &Client, args: Args) -> Result<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let body = body::resolve(args.body.as_deref(), args.body_file.as_deref())?.unwrap_or_default();
|
let body = body::resolve_required(
|
||||||
|
args.body.as_deref(),
|
||||||
|
args.body_file.as_deref(),
|
||||||
|
"issue-create",
|
||||||
|
)?;
|
||||||
let (owner, name) = client.owner_repo()?;
|
let (owner, name) = client.owner_repo()?;
|
||||||
let label_ids = if args.labels.is_empty() {
|
let label_ids = if args.labels.is_empty() {
|
||||||
None
|
None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue