Skip to content

Instantly share code, notes, and snippets.

@basilfx

basilfx/sonar.py Secret

Created Apr 23, 2020
Embed
What would you like to do?
SONARCLOUD_ORGANIZATION = ""
SONARCLOUD_TOKEN = ""
def post_sonarcloud_setting(name, key, value):
response = requests.post(
"https://sonarcloud.io/api/settings/set",
data={
"organization": SONARCLOUD_ORGANIZATION,
"component": name,
"key": key,
"value": value
},
auth=(SONARCLOUD_TOKEN, ""))
response.raise_for_status()
post_sonarcloud_setting(
repository,
"sonar.pullrequest.vsts.token.secured",
"VSTS token here")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment