Skip to content
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

Added Deleted field to support codecommit ref delete events #531

Merged
merged 6 commits into from Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion events/code_commit.go
Expand Up @@ -91,11 +91,12 @@ type CodeCommitReference struct {
Commit string `json:"commit"`
Ref string `json:"ref"`
Created bool `json:"created,omitempty"`
Deleted bool `json:"deleted,omitempty"`
}

// String returns a string representation of this object.
// Useful for testing and debugging.
func (r CodeCommitReference) String() string {
return fmt.Sprintf(
"{commit: %v, ref: %v, created: %v}", r.Commit, r.Ref, r.Created)
"{commit: %v, ref: %v, created: %v, deleted: %v}", r.Commit, r.Ref, r.Created, r.Deleted)
}
15 changes: 15 additions & 0 deletions events/code_commit_test.go
Expand Up @@ -28,6 +28,16 @@ func TestCodeCommitReference(t *testing.T) {
"ref": "refs/heads/master",
"created": true
}
`),
},
{
Name: "Deleted CodeCommitReference",
Input: []byte(`
{
"commit": "5c4ef1049f1d27deadbeeff313e0730018be182b",
"ref": "refs/heads/master",
"deleted": true
}
`),
},
}
Expand Down Expand Up @@ -62,6 +72,11 @@ func TestCodeCommitCodeCommit(t *testing.T) {
"commit": "5c4ef1049f1d27deadbeeff313e0730018be182b",
"ref": "refs/heads/master",
"created": true
},
{
"commit": "5c4ef1049f1d27deadbeeff313e0730018be182b",
"ref": "refs/heads/master",
"deleted": true
}
]
}
Expand Down