From e6ae1f7f74b76685b907447751b6e7345a7e70c9 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Wed, 11 Sep 2024 18:38:28 +0300 Subject: [PATCH] BM6 --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0ef5ff8..5c67b3f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -397,9 +397,11 @@ def unprotectBranch(String repo, String branch) { return sh ( label: "${repo}: unprotect ${branch}", script: """ - curl -s -X 'DELETE' \ + HTTP_CODE=\$(curl -s -X 'DELETE' \ 'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branchUrl}' \ - -H 'Authorization: token '"\$GITEA_TOKEN" + -H 'Authorization: token '"\$GITEA_TOKEN" \ + -w '%{http_code}' \ + -o output.json) """, returnStatus: true ) == 0