Skip to content

Commit

Permalink
Merge pull request #18 from fga-eps-mds/sonarChanges
Browse files Browse the repository at this point in the history
fix: sonar test coverage
  • Loading branch information
matheusyanmonteiro authored Feb 5, 2025
2 parents b970427 + d35de2e commit 7cdc4be
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sonar_scripts/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
######################################
TODAY = datetime.now()
load_dotenv()
SONARCLOUD_TOKEN = os.getenv('SONARCLOUD_TOKEN') # Seu token de acesso do SonarCloud
QUALITY_GATE_ID = os.getenv('QUALITY_GATE_ID') # ID da Quality Gate que você deseja atualizar

url = 'https://sonarcloud.io/api/qualitygates/update_condition'
params = {
'gateId': QUALITY_GATE_ID,
'metric': 'coverage',
'op': 'LT', # "Less Than" – a condição será acionada se a cobertura for menor que o valor definido
'error': 30, # Novo threshold de cobertura (30%)
}

response = requests.post(url, params=params, auth=HTTPBasicAuth(SONARCLOUD_TOKEN, ''))
print(response.json())
# Variáveis globais ao repositório
OWNER = "fga-eps-mds"
REPO = os.getenv('REPO')
Expand Down

0 comments on commit 7cdc4be

Please sign in to comment.