This commit is contained in:
Semyon Bezrukov 2024-09-11 17:37:33 +03:00
parent 7247dbe4a4
commit 180496fde6

4
Jenkinsfile vendored
View File

@ -378,7 +378,7 @@ def protectBranch(String repo, String branch) {
curl -sv -X 'POST' \
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections' \
-H 'accept: application/json' \
-H 'Authorization: '"\$GITEA_TOKEN" \
-H 'Authorization: token '"\$GITEA_TOKEN" \
-H 'Content-Type: application/json' \
-d @-
""",
@ -393,7 +393,7 @@ def unprotectBranch(String repo, String branch) {
curl -sv -X 'DELETE' \
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branch}' \
-H 'accept: application/json' \
-H 'Authorization: '"\$GITEA_TOKEN"
-H 'Authorization: token '"\$GITEA_TOKEN"
""",
returnStatus: true
) == 0