mirror of
https://gitea.com/gitea/tea.git
synced 2026-02-22 06:13:32 +01:00
- switch to golangci-lint for linting - switch to gofmpt for formatting - fix lint and fmt issues that came up from switch to new tools - upgrade go-sdk to 0.23.2 - support pagination for listing tracked times - remove `FixPullHeadSha` workaround (upstream fix has been merged for 5+ years at this point) - standardize on US spelling (previously a mix of US&UK spelling) - remove some unused code - reduce some duplication in parsing state and issue type - reduce some duplication in reading input for secrets and variables - reduce some duplication with PR Review code - report error for when yaml parsing fails - various other misc cleanup Reviewed-on: https://gitea.com/gitea/tea/pulls/869 Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-committed-by: techknowlogick <techknowlogick@gitea.com>
27 lines
709 B
Go
27 lines
709 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package pulls
|
|
|
|
import (
|
|
"context"
|
|
|
|
"code.gitea.io/tea/cmd/flags"
|
|
|
|
"code.gitea.io/sdk/gitea"
|
|
"github.com/urfave/cli/v3"
|
|
)
|
|
|
|
// CmdPullsClose closes a given open pull request
|
|
var CmdPullsClose = cli.Command{
|
|
Name: "close",
|
|
Usage: "Change state of one or more pull requests to 'closed'",
|
|
Description: `Change state of one or more pull requests to 'closed'`,
|
|
ArgsUsage: "<pull index> [<pull index>...]",
|
|
Action: func(ctx context.Context, cmd *cli.Command) error {
|
|
s := gitea.StateClosed
|
|
return editPullState(ctx, cmd, gitea.EditPullRequestOption{State: &s})
|
|
},
|
|
Flags: flags.AllDefaultFlags,
|
|
}
|