Skip to content

Instantly share code, notes, and snippets.

@jonathanmedd
Created November 19, 2021 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanmedd/f02f36cf7be8fb0aef575172b15d8c35 to your computer and use it in GitHub Desktop.
Save jonathanmedd/f02f36cf7be8fb0aef575172b15d8c35 to your computer and use it in GitHub Desktop.
List the branches of a SonarCloud project
$parameters = @{
project = 'testorg_test-project-1'
}
$branches = Invoke-SonarCloudRestMethod -Method GET -URI '/project_branches/list' -queryParameters $parameters
$branches.branches
name : develop
isMain : True
type : LONG
status : @{qualityGateStatus=OK}
analysisDate : 11/10/2021 12:57:12
commit : @{sha=a2dd1ecfa362850605349908b717ee17acb67c92c5f63502d25fbc3baf4ae31c; author=; date=11/10/2021 12:53:06; message=Merge branch 'feature01' into 'develop'}
name : feature-001
isMain : False
type : SHORT
mergeBranch : develop
status : @{qualityGateStatus=OK; bugs=0; vulnerabilities=0; codeSmells=0}
analysisDate : 08/10/2021 07:16:20
commit : @{sha=e559e554c7861f672022c07dabdf4d3d2b764b1d8162fdd268996febc2d65e23; author=; date=08/10/2021 07:11:58; message=Update README.md}
name : feature-002
isMain : False
type : SHORT
mergeBranch : develop
status : @{qualityGateStatus=OK; bugs=0; vulnerabilities=0; codeSmells=0}
analysisDate : 07/10/2021 15:38:29
commit : @{sha=c6411aea082e2c5d74347368677db69545126237d5ed78faa0846352f5383f95; author=; date=07/10/2021 15:34:14; message=Update Dockerfile}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment