Skip to content

Commit e538921

Browse files
committed
more testing
1 parent 617310d commit e538921

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

container-action/entrypoint.sh

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,23 @@ POWPEG_NODE_BRANCH="${INPUT_POWPEG_NODE_BRANCH}"
66
RIT_BRANCH="${INPUT_RIT_BRANCH}"
77
LOG_LEVEL="${INPUT_RIT_LOG_LEVEL}"
88
REPO_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"
2115
else
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"
2317
fi
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

4428
echo -e "\n\n--------- Input parameters received ---------\n\n"

0 commit comments

Comments
 (0)