File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626 - name : Run install script
2727 shell : bash
28- run : bash install-cli.sh --debug
28+ run : bash install-cli.sh --debug --token ${{ secrets.GITHUB_TOKEN }}
2929
3030 - name : Verify installation
3131 shell : bash
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ ARCH="unknown"
1010VERSION=" "
1111FILE_NAME=" kosli"
1212DEBUG=false
13+ GITHUB_TOKEN=" "
1314
1415# --- Debug function ---
1516debug_print () {
@@ -26,6 +27,16 @@ while [ $# -gt 0 ]; do
2627 debug_print " Debug mode enabled"
2728 shift
2829 ;;
30+ --token)
31+ if [ -n " ${2:- } " ]; then
32+ GITHUB_TOKEN=" $2 "
33+ debug_print " GitHub token provided"
34+ shift 2
35+ else
36+ echo " Error: --token requires a value"
37+ exit 1
38+ fi
39+ ;;
2940 * )
3041 VERSION=$1
3142 debug_print " Version specified: $VERSION "
4657 RETRY_COUNT=0
4758 MAX_RETRIES=5
4859 while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
49- METADATA=$( curl -s " https://api.github.com/repos/kosli-dev/cli/releases/latest" )
60+ if [ -n " $GITHUB_TOKEN " ]; then
61+ debug_print " Using GitHub token for API request"
62+ METADATA=$( curl -s -H " Authorization: token $GITHUB_TOKEN " " https://api.github.com/repos/kosli-dev/cli/releases/latest" )
63+ else
64+ debug_print " Using unauthenticated API request"
65+ METADATA=$( curl -s " https://api.github.com/repos/kosli-dev/cli/releases/latest" )
66+ fi
5067 debug_print " GitHub API response: $METADATA "
5168
5269 # Check if the response contains the expected tag_name
You can’t perform that action at this time.
0 commit comments