Skip to content

Commit 2bc31ae

Browse files
authored
Merge pull request #2011 from RynoCODE/master
Add timeout to curl command in branch validation
2 parents e611c57 + d7794c3 commit 2bc31ae

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23

34
# Usage function
45
usage() {
@@ -48,7 +49,7 @@ check_branch_exists() {
4849
fi
4950

5051
local http_code
51-
http_code=$(curl -sI "$url" -o /dev/null -w "%{http_code}")
52+
http_code=$(curl -sI --max-time 10 "$url" -o /dev/null -w "%{http_code}")
5253
if [ "${http_code}" -ne 200 ]; then
5354
echo "Error: $repo branch '$branch' not found. Exiting."
5455
exit 1

0 commit comments

Comments
 (0)