Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
air-hand committed Aug 29, 2024
1 parent 0a1b47e commit b7927e8
Show file tree
Hide file tree
Showing 5 changed files with 530 additions and 8 deletions.
3 changes: 2 additions & 1 deletion github/actions_workflow_runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep
return workflowRunUsage, resp, nil
}

// GetPendingDeployments Get all deployment environments for a workflow run that are waiting for protection rules to pass.
// GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run
//
Expand Down Expand Up @@ -457,6 +457,7 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str
}

// ReviewCustomDeploymentProtectionRule approve or reject custom deployment protection rules provided by a GitHub App for a workflow run
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run
//
//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule
Expand Down
15 changes: 9 additions & 6 deletions github/event_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,19 @@ type DeploymentProtectionRuleEvent struct {
//
// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads?#deployment_review
type DeploymentReviewEvent struct {
Action *string `json:"action,omitempty"`
// FIXME omitされる場合を考えると、並び順は変えたほうがよいかもしれない
Approver *User `json:"approver,omitempty"`
Environment *string `json:"environment,omitempty"`
Comment *string `json:"comment,omitempty"`
Action *string `json:"action,omitempty"`
Comment *string `json:"comment,omitempty"`
// requester only populated when requested.
Requester *User `json:"requester,omitempty"`
// approver only populated when approved or rejected.
Approver *User `json:"approver,omitempty"`

Environment *string `json:"environment,omitempty"`

Enterprise *Enterprise `json:"enterprise,omitempty"`
Installation *Installation `json:"installation,omitempty"`
Organization *Organization `json:"organization,omitempty"`
Repo *Repository `json:"repository,omitempty"`
Requester *User `json:"requester,omitempty"`
Reviewers []*RequiredReviewer `json:"reviewers,omitempty"`
Sender *User `json:"sender,omitempty"`
Since *string `json:"since,omitempty"`
Expand Down
10 changes: 9 additions & 1 deletion github/event_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6392,7 +6392,15 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) {
}

func TestDeploymentReviewEvent_Marshal(t *testing.T) {
testJSONMarshal(t, &DeploymentReviewEvent{}, "FIXME")
testJSONMarshal(t, &DeploymentReviewEvent{}, "{}")

u := &DeploymentReviewEvent{}

want := `{
"fix": "me"
}`

testJSONMarshal(t, u, want)
}

func TestDeploymentStatusEvent_Marshal(t *testing.T) {
Expand Down
240 changes: 240 additions & 0 deletions github/github-accessors.go

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

Loading

0 comments on commit b7927e8

Please sign in to comment.