Skip to content

Commit 706bab4

Browse files
authored
Adding fail catch to curl command (#3798)
1 parent 4e73be2 commit 706bab4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.buildkite/hooks/pre-command

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ check_if_file_exist_in_repo() {
2323
branchName="master"
2424
fi
2525
local path_to_file="cd/release/release-manager/project-configs/${branchName}/${fileName}"
26-
local response=$(curl -s -H "Authorization: token $GITHUB_REPO_TOKEN" https://api.github.com/repos/elastic/${repoName}/contents/${path_to_file}| grep -c "\"path\"\: \"${path_to_file}\"")
26+
local response=$(curl --fail -s -H "Authorization: token $GITHUB_REPO_TOKEN" https://api.github.com/repos/elastic/${repoName}/contents/${path_to_file}| grep -c "\"path\"\: \"${path_to_file}\"")
2727
if [[ ${response} -ge 1 ]]; then
2828
export FILE_EXISTS_IN_REPO=true
2929
echo "FILE_EXIST_IN_REPO = true"

0 commit comments

Comments
 (0)