-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: github app #360
base: main
Are you sure you want to change the base?
feat: github app #360
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
PipelineType *string `json:"pipeline_type,omitempty"` | ||
PreviousName *string `json:"previous_name,omitempty"` | ||
ApproveBuild *string `json:"approve_build,omitempty"` | ||
InstallID *int64 `json:"install_id,omitempty"` | ||
} | ||
|
||
// Environment returns a list of environment variables | ||
|
@@ -64,6 +65,7 @@ | |
"VELA_REPO_VISIBILITY": ToString(r.GetVisibility()), | ||
"VELA_REPO_PIPELINE_TYPE": ToString(r.GetPipelineType()), | ||
"VELA_REPO_APPROVE_BUILD": ToString(r.GetApproveBuild()), | ||
"VELA_REPO_INSTALL_ID": ToString(r.GetInstallID()), | ||
|
||
// deprecated environment variables | ||
"REPOSITORY_ACTIVE": ToString(r.GetActive()), | ||
|
@@ -424,6 +426,19 @@ | |
return *r.ApproveBuild | ||
} | ||
|
||
// GetInstallID returns the InstallID field. | ||
// | ||
// When the provided Repo type is nil, or the field within | ||
// the type is nil, it returns the zero value for the field. | ||
func (r *Repo) GetInstallID() int64 { | ||
// return zero value if Repo type or InstallID field is nil | ||
if r == nil || r.InstallID == nil { | ||
return 0 | ||
} | ||
|
||
return *r.InstallID | ||
} | ||
|
||
// SetID sets the ID field. | ||
// | ||
// When the provided Repo type is nil, it | ||
|
@@ -762,9 +777,22 @@ | |
r.ApproveBuild = &v | ||
} | ||
|
||
// SetInstallID sets the InstallID field. | ||
// | ||
// When the provided Repo type is nil, it | ||
// will set nothing and immediately return. | ||
func (r *Repo) SetInstallID(v int64) { | ||
// return if Repo type is nil | ||
if r == nil { | ||
return | ||
} | ||
|
||
r.InstallID = &v | ||
} | ||
|
||
// String implements the Stringer interface for the Repo type. | ||
// | ||
//nolint:dupl // ignore duplicate with test func | ||
Check failure on line 795 in library/repo.go
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
func (r *Repo) String() string { | ||
return fmt.Sprintf(`{ | ||
Active: %t, | ||
|
@@ -781,6 +809,7 @@ | |
Counter: %d, | ||
FullName: %s, | ||
ID: %d, | ||
InstallID: %d, | ||
Link: %s, | ||
Name: %s, | ||
Org: %s, | ||
|
@@ -807,6 +836,7 @@ | |
r.GetCounter(), | ||
r.GetFullName(), | ||
r.GetID(), | ||
r.GetInstallID(), | ||
r.GetLink(), | ||
r.GetName(), | ||
r.GetOrg(), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
GithubInstallID
? OrSCMMetadata
with a JSON field?