Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions github/enterprise_actions_runner_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type EnterpriseRunnerGroup struct {
Default *bool `json:"default,omitempty"`
SelectedOrganizationsURL *string `json:"selected_organizations_url,omitempty"`
RunnersURL *string `json:"runners_url,omitempty"`
HostedRunnersURL *string `json:"hosted_runners_url,omitempty"`
NetworkConfigurationID *string `json:"network_configuration_id,omitempty"`
Inherited *bool `json:"inherited,omitempty"`
AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"`
RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"`
Expand Down Expand Up @@ -51,6 +53,8 @@ type CreateEnterpriseRunnerGroupRequest struct {
RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"`
// List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true.
SelectedWorkflows []string `json:"selected_workflows,omitempty"`
// The identifier of a hosted compute network configuration.
NetworkConfigurationID *string `json:"network_configuration_id,omitempty"`
}

// UpdateEnterpriseRunnerGroupRequest represents a request to update a Runner group for an enterprise.
Expand All @@ -60,6 +64,7 @@ type UpdateEnterpriseRunnerGroupRequest struct {
AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"`
RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"`
SelectedWorkflows []string `json:"selected_workflows,omitempty"`
NetworkConfigurationID *string `json:"network_configuration_id,omitempty"`
}

// SetOrgAccessRunnerGroupRequest represents a request to replace the list of organizations
Expand Down
16 changes: 14 additions & 2 deletions github/enterprise_actions_runner_groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ func TestEnterpriseRunnerGroup_Marshal(t *testing.T) {
Default: Ptr(true),
SelectedOrganizationsURL: Ptr("s"),
RunnersURL: Ptr("r"),
HostedRunnersURL: Ptr("h"),
NetworkConfigurationID: Ptr("nc"),
Inherited: Ptr(true),
AllowsPublicRepositories: Ptr(true),
RestrictedToWorkflows: Ptr(false),
Expand All @@ -553,6 +555,8 @@ func TestEnterpriseRunnerGroup_Marshal(t *testing.T) {
"default": true,
"selected_organizations_url": "s",
"runners_url": "r",
"hosted_runners_url": "h",
"network_configuration_id": "nc",
"inherited": true,
"allows_public_repositories": true,
"restricted_to_workflows": false
Expand All @@ -575,6 +579,8 @@ func TestEnterpriseRunnerGroups_Marshal(t *testing.T) {
Default: Ptr(true),
SelectedOrganizationsURL: Ptr("s"),
RunnersURL: Ptr("r"),
HostedRunnersURL: Ptr("h"),
NetworkConfigurationID: Ptr("nc"),
Inherited: Ptr(true),
AllowsPublicRepositories: Ptr(true),
RestrictedToWorkflows: Ptr(false),
Expand All @@ -591,6 +597,8 @@ func TestEnterpriseRunnerGroups_Marshal(t *testing.T) {
"default": true,
"selected_organizations_url": "s",
"runners_url": "r",
"hosted_runners_url": "h",
"network_configuration_id": "nc",
"inherited": true,
"allows_public_repositories": true,
"restricted_to_workflows": false
Expand All @@ -612,6 +620,7 @@ func TestCreateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) {
AllowsPublicRepositories: Ptr(true),
RestrictedToWorkflows: Ptr(true),
SelectedWorkflows: []string{"a", "b"},
NetworkConfigurationID: Ptr("nc-123"),
}

want := `{
Expand All @@ -621,7 +630,8 @@ func TestCreateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) {
"runners": [1],
"allows_public_repositories": true,
"restricted_to_workflows": true,
"selected_workflows": ["a","b"]
"selected_workflows": ["a","b"],
"network_configuration_id": "nc-123"
}`

testJSONMarshal(t, u, want)
Expand All @@ -636,13 +646,15 @@ func TestUpdateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) {
Visibility: Ptr("v"),
AllowsPublicRepositories: Ptr(true),
RestrictedToWorkflows: Ptr(false),
NetworkConfigurationID: Ptr("nc-456"),
}

want := `{
"name": "n",
"visibility": "v",
"allows_public_repositories": true,
"restricted_to_workflows": false
"restricted_to_workflows": false,
"network_configuration_id": "nc-456"
}`

testJSONMarshal(t, u, want)
Expand Down
32 changes: 32 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading