From 9556faabb9c99e3df8d6898f0b9d6231ba6fe409 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 23 Dec 2024 13:35:52 -0500 Subject: [PATCH] feat: Add option to create draft issues from the new-issue script --- .github/scripts/new_issue.sh | 13 ++++++++++--- Taskfile.yml | 6 ++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/scripts/new_issue.sh b/.github/scripts/new_issue.sh index f02b5de3a..e28414117 100755 --- a/.github/scripts/new_issue.sh +++ b/.github/scripts/new_issue.sh @@ -56,8 +56,15 @@ preview_output | gum format # Confirm to create a GitHub issue if gum confirm "Do you want to create a new GitHub issue with this information?"; then - # Create a new GitHub issue using the gh CLI - gh issue create --repo onsonr/sonr --title "($SCOPE) $TITLE" --body "$ISSUE_BODY" + # Ask if this should be a draft issue + if gum confirm "Create as draft issue?"; then + # Create a draft GitHub issue + gh issue create --repo onsonr/sonr --title "($SCOPE) $TITLE" --body "$ISSUE_BODY" + else + # Create a regular GitHub issue + gh issue create --repo onsonr/sonr --title "($SCOPE) $TITLE" --body "$ISSUE_BODY" -a @me + fi else - exit 1 + exit 1 fi + diff --git a/Taskfile.yml b/Taskfile.yml index 858c6a793..03b289ec3 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -51,6 +51,12 @@ tasks: - for: { var: DEPS } cmd: gum spin --spinner dot --title "Installing go dependencies..." -- go install {{.ITEM}} + new-issue: + desc: Create a new issue + silent: true + dir: .github/scripts + cmds: + - sh new_issue.sh pkl-gen: desc: Generate PKL files silent: true