From c8692d6186abc1728d512b85037000c09c9ec2eb Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Wed, 11 Sep 2024 17:08:10 +0300 Subject: [PATCH] BM8 --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b004a62..f5d8cb9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -361,7 +361,7 @@ def printBranches(String repo) { curl -sv -X 'GET' \ 'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branches' \ -H 'accept: application/json' \ - -H 'Authorization: \$GITEA_TOKEN' | \ + -H 'Authorization: '"\$GITEA_TOKEN" | \ jq -r '.[] | [.name, .protected] | @tsv' """, returnStatus: true @@ -376,9 +376,9 @@ def protectBranch(String repo, String branch) { "branch_name": "master" }' | \ curl -sv -X 'POST' \ - 'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections?token=\$GITEA_TOKEN' \ + 'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections' \ -H 'accept: application/json' \ - -H 'Authorization: \$GITEA_TOKEN' \ + -H 'Authorization: '"\$GITEA_TOKEN" \ -H 'Content-Type: application/json' \ -d - """, @@ -391,9 +391,9 @@ def unprotectBranch(String repo, String branch) { label: "${repo}: unprotect ${branch}", script: """ curl -sv -X 'DELETE' \ - 'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branch}?token=\$GITEA_TOKEN' \ + 'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branch}' \ -H 'accept: application/json' \ - -H 'Authorization: \$GITEA_TOKEN' + -H 'Authorization: '"\$GITEA_TOKEN" """, returnStatus: true ) == 0