# shellcheck shell=dash disable=SC2154
# https://docs.github.com/en/rest/releases/releases#update-a-release
___x_cmd_gh_repo_release_edit() {
    param:scope  ___x_cmd_github
    param:dsl    '
options:
    #1                      "Release ID"                                                            <>:number
    --repo|-r               "<owner_path>/<repo_path>"                                              <>:RepoName
    --tag_name              "The name of the tag."                                                  <>=""
    --target_commitish      "Is release version"                                                    <>=""
    --name                  "The name of the release."                                              <>=""
    --body                  "Text describing the contents of the tag."                              <>=""

    --draft                 "true makes the release a draft, and false publishes the release."
    --prerelease            "true to identify the release as a prerelease, false to identify the release as a full release."
    --json|-j               "output json data"
'
    param:run
    ___x_cmd_gh_param_init_owner_repo
    local gen_gh_json=""
    gen_gh_json="$(param:option2json -repo)"
    gh:debug "$gen_gh_json"

    ___x_cmd_gh_curl patch "/repos/${owner_repo}/releases/${1##*/}" "gen_gh_json" | ___x_cmd_gh_release____ui_handler Edit
}