Listar / adicionar / editar problemas do Github a partir de scripts de shell

issue.sh

  • liste todos os problemas do seu repositório atual
  • adicionar um novo problema
  • editar questões

issue_list.sh



###################
# list issues
###################

# get user name
username
=`git config github.user`
if [ "$username" = "" ]; then
echo
"Could not find username, run 'git config --global github.user <username>'"
invalid_credentials
=1
fi

# get repository name
repo_name
=`basename $(git rev-parse --show-toplevel)`

# list all issue
curl https
://api.github.com/repos/$username/$repo_name/issues > issues.txt

# extract texts
awk
'/number/{print $2}' issues.txt > tmp1.txt
awk
'/title/{result = ""; for(i=2;i<=NF;++i) result = result " " $i; print result}' issues.txt > tmp2.txt

# formats
echo
"========================="
echo
"No.tTitle"
echo
"-------------------------"
paste
-d"t" tmp1.txt tmp2.txt | tr -d "