This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add co-author trailers to merge commit.
When creating the merge commit for a batch, add a "Co-authored-by" trailer to the commit message for each author contributing to the batch. Fixes: #382
- Loading branch information
Showing
8 changed files
with
512 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
defmodule BorsNG.GitHub.Commit do | ||
@moduledoc """ | ||
The structure of GitHub commit data. | ||
""" | ||
|
||
defstruct sha: "", author_name: "", author_email: "" | ||
|
||
@type tjson :: map | ||
|
||
@type t :: %BorsNG.GitHub.Commit{ | ||
sha: bitstring, | ||
author_name: bitstring, | ||
author_email: bitstring, | ||
} | ||
|
||
@doc """ | ||
Convert from Poison-decoded JSON to a Commit struct. | ||
""" | ||
@spec from_json!(tjson) :: t | ||
def from_json!(json) do | ||
{:ok, pr} = from_json(json) | ||
pr | ||
end | ||
|
||
@doc """ | ||
Convert from Poison-decoded JSON to a Commit struct. | ||
""" | ||
@spec from_json(tjson) :: {:ok, t} | :err | ||
def from_json(%{ | ||
"sha" => sha, | ||
"commit" => %{ | ||
"author" => %{ | ||
"name" => author_name, | ||
"email" => author_email, | ||
}, | ||
}, | ||
}) do | ||
{:ok, %BorsNG.GitHub.Commit{ | ||
sha: sha, | ||
author_name: author_name, | ||
author_email: author_email, | ||
}} | ||
end | ||
|
||
def from_json(x) do | ||
{:error, x} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.