This commit is contained in:
Semyon Bezrukov 2024-09-11 18:38:28 +03:00
parent b76da282f2
commit e6ae1f7f74

6
Jenkinsfile vendored
View File

@ -397,9 +397,11 @@ def unprotectBranch(String repo, String branch) {
return sh ( return sh (
label: "${repo}: unprotect ${branch}", label: "${repo}: unprotect ${branch}",
script: """ script: """
curl -s -X 'DELETE' \ HTTP_CODE=\$(curl -s -X 'DELETE' \
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branchUrl}' \ '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 returnStatus: true
) == 0 ) == 0