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