1

NOTE: rename the title of Utterances issues

 1 year ago
source link: https://dannypsnl.github.io/blog/2022/07/04/cs/gh-commands/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Rename the title of Utterances issues can be helpful when moving site to different URL, the following code is how can we make it.NOTE: rename the title of Utterances issues

Email: [email protected]
GitHub: @dannypsnl
Twitter: @dannypsnl

Programming Language Theory • System Programming

NOTE: rename the title of Utterances issues

Rename the title of Utterances issues can be helpful when moving site to different URL, the following code is how can we make it.

read -p "current URL of site? " current_site_url
read -p "new URL of site? " new_site_url

if [ -z ${current_site_url} ]; then exit 0; fi
if [ -z ${new_site_url} ]; then exit 0; fi

gh issue list --label Utterances --json number,title --jq '.[] | [.title, .number] | @tsv' |
    while IFS=$'\t' read -r title number; do
        echo "Handle issue ${number}..."
        new_title=$(echo ${title} | sed "s/${current_site_url}/${new_site_url}/g")
        gh issue edit ${number} --title ${new_title}
        echo "Rename ${title} to ${new_title}"
    done

author: Lîm Tsú-thuàn/林子篆/Danny

category:cs

tag:notegithub

Similar Articles

All works in this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
©2022 dannypsnl(林子篆)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK