@@ -6,39 +6,23 @@ POWPEG_NODE_BRANCH="${INPUT_POWPEG_NODE_BRANCH}"
66RIT_BRANCH=" ${INPUT_RIT_BRANCH} "
77LOG_LEVEL=" ${INPUT_RIT_LOG_LEVEL} "
88REPO_OWNER=" ${INPUT_REPO_OWNER:- rsksmart} " # Default to 'rsksmart' if not provided
9- IS_RSKJ_BRANCH=$( git ls-remote " https://github.com/$REPO_OWNER /rskj.git" " $RSKJ_BRANCH " )
10- IS_POWPEG_BRANCH=$( git ls-remote " https://github.com/$REPO_OWNER /powpeg-node.git" " $POWPEG_NODE_BRANCH " )
119
1210# Check if the branch exists
13- if [ -n " $IS_RSKJ_BRANCH " ]; then
14- echo " Branch '$RSKJ_BRANCH ' exists in repository '$REPO_OWNER /rskj.git'."
15- else
16- echo " Branch '$RSKJ_BRANCH ' does not exist in repository '$REPO_OWNER /rskj.git'."
17- fi
11+ IS_RSKJ_BRANCH=$( curl -s -o /dev/null -w " %{http_code}" " https://api.github.com/repos/$REPO_OWNER /rskj/branches/$RSKJ_BRANCH " )
1812
19- if [ -n " $IS_POWPEG_BRANCH " ]; then
20- echo " Branch '$POWPEG_NODE_BRANCH ' exists in repository ' $REPO_OWNER /powpeg-node .git'. "
13+ if [ " $IS_RSKJ_BRANCH " -eq 200 ]; then
14+ echo " Branch '$RSKJ_BRANCH ' exists in $REPO_OWNER /rskj .git"
2115else
22- echo " Branch '$POWPEG_NODE_BRANCH ' does not exist in repository ' $REPO_OWNER /powpeg-node .git'. "
16+ echo " Branch '$RSKJ_BRANCH ' does not exist in $REPO_OWNER /rskj .git"
2317fi
2418
19+ IS_POWPEG_BRANCH=$( curl -s -o /dev/null -w " %{http_code}" " https://api.github.com/repos/$REPO_OWNER /powpeg-node/branches/$POWPEG_NODE_BRANCH " )
2520
26- # Check if the branch exists
27- # IS_RSKJ_BRANCH=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/$REPO_OWNER/rskj/branches/$RSKJ_BRANCH")
28-
29- # if [ "$IS_RSKJ_BRANCH" -eq 200 ]; then
30- # echo "Branch '$RSKJ_BRANCH' exists in $REPO_OWNER/rskj.git"
31- # else
32- # echo "Branch '$RSKJ_BRANCH' does not exist in $REPO_OWNER/rskj.git"
33- # fi
34-
35- # IS_POWPEG_BRANCH=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/$REPO_OWNER/powpeg-node/branches/$POWPEG_NODE_BRANCH")
36-
37- # if [ "$IS_POWPEG_BRANCH" -eq 200 ]; then
38- # echo "Branch '$POWPEG_NODE_BRANCH' exists in $REPO_OWNER/powpeg-node.git"
39- # else
40- # echo "Branch '$POWPEG_NODE_BRANCH' does not exist in $REPO_OWNER/powpeg-node.git"
41- # fi
21+ if [ " $IS_POWPEG_BRANCH " -eq 200 ]; then
22+ echo " Branch '$POWPEG_NODE_BRANCH ' exists in $REPO_OWNER /powpeg-node.git"
23+ else
24+ echo " Branch '$POWPEG_NODE_BRANCH ' does not exist in $REPO_OWNER /powpeg-node.git"
25+ fi
4226
4327
4428echo -e " \n\n--------- Input parameters received ---------\n\n"
0 commit comments