Documentation ¶
Overview ¶
Package ccaddrepo allows to add a GitHub repository to CodeClimate and setup its report id as a CC_TEST_REPORTER_ID secret in the repository.
This two function works together in order to automate the setup of a GitHub repository.
If you are using this package in GitHub Actions, you can easily publish coverages reports to CodeClimate using e.g. paambaati/codeclimate-action(https://github.com/paambaati/codeclimate-action)
Package ccaddrepo allows to add a GitHub repository to CodeClimate and setup its report id as a CC_TEST_REPORTER_ID secret in the repository.
This two function works together in order to automate the setup of a GitHub repository.
If you are using this package in GitHub Actions, you can easily publish coverages reports to CodeClimate using e.g. paambaati/codeclimate-action(https://github.com/paambaati/codeclimate-action)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetReporterIDSecret ¶
func SetReporterIDSecret(options SecretsOptions) error
SetReporterIDSecret setup a secret on a github repository named CC_TEST_REPORTER_ID containing the specified reporterID. The function uses GitHub API to add the secret, so a ghtoken has to be specified.
Example ¶
package main import ( "github.com/parrogo/ccaddrepo" ) func main() { err := ccaddrepo.SetReporterIDSecret(ccaddrepo.SecretsOptions{ RepoSlug: "", GHToken: "", ReporterID: "", BadgeID: "", ID: "", }) if err != nil { panic(err) } }
Output:
Types ¶
type CodeClimate ¶ added in v1.1.5
type CodeClimate string
CodeClimate represent an authenticated session on Code Climate.
Example ¶
This example show how to use ccaddrepo.AddOnCodeClimate()
package main import ( "fmt" "github.com/parrogo/ccaddrepo" ) func main() { cc := ccaddrepo.CodeClimate("token") reporterID, err := cc.AddRepo("author/repo") if err != nil { panic(err) } fmt.Println(reporterID) }
Output:
func (CodeClimate) AddRepo ¶ added in v1.1.5
func (cc CodeClimate) AddRepo(reposlug string) (*RepoInfo, error)
AddRepo create a repository within an organization and return the reporter ID.
func (CodeClimate) DeleteRepo ¶ added in v1.1.5
func (cc CodeClimate) DeleteRepo(repoid string) error
DeleteRepo remove a repository from CodeClimate
func (CodeClimate) GetOwnOrgID ¶ added in v1.1.5
func (cc CodeClimate) GetOwnOrgID(orgname string) (string, error)
GetOwnOrgID returns the ID of an organization