Add missing fields to BranchProtection and related structs #626
Labels
No Label
has/backport
has/pull
in progress
invalid
kind/breaking
kind/bug
kind/build
kind/deployment
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/proposal
kind/question
kind/refactor
kind/security
kind/testing
kind/translation
kind/ui
need/backport
priority/critical
priority/low
priority/maybe
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/go-sdk#626
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch ":add-branch-protection-rule-name"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
the
gitea.BranchProtection
struct is missing some fields which are present in the actual gitea API (and swagger).This PR adds those fields to the BranchProtection struct, and the related Create and Edit option structs, to match the structs defined on the gitea server side.
By the way, your PR template needs an update. It says:
However, the default branch for go-sdk seems to be
main
, notmaster
.@ -86,6 +90,7 @@ type EditBranchProtectionOption struct {
DismissStaleApprovals *bool `json:"dismiss_stale_approvals"`
RequireSignedCommits *bool `json:"require_signed_commits"`
ProtectedFilePatterns *string `json:"protected_file_patterns"`
UnprotectedFilePatterns string `json:"unprotected_file_patterns"`
This should likely be a pointer so that
nil
is usable and doesn't marshal an empty string.Fixed. Good catch, thanks.
ef0cc2820c
tofbfdb2173a
fbfdb2173a
to7dd8441d0b
I rebased to current main.