aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-11-26 14:53:39 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-11-27 08:49:24 +0200
commit9d853826320cd39a3b96c6ecdc4ae8a855784e99 (patch)
treee3f35bcf02cfeac3739c43bbd2ec3fb8b24448df /mod
parent136f94d0602b1d6ffb5061205fc6d08c1bb6a4d6 (diff)
gh_pull_request_event: Add `before` member
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-ci-github-gh.cxx4
-rw-r--r--mod/mod-ci-github-gh.hxx6
2 files changed, 9 insertions, 1 deletions
diff --git a/mod/mod-ci-github-gh.cxx b/mod/mod-ci-github-gh.cxx
index 6372ef0..6ab93d7 100644
--- a/mod/mod-ci-github-gh.cxx
+++ b/mod/mod-ci-github-gh.cxx
@@ -513,7 +513,7 @@ namespace brep
{
p.next_expect (event::begin_object);
- bool ac (false), pr (false), rp (false), in (false);
+ bool ac (false), pr (false), bf (false), rp (false), in (false);
// Skip unknown/uninteresting members.
//
@@ -526,6 +526,7 @@ namespace brep
if (c (ac, "action")) action = p.next_expect_string ();
else if (c (pr, "pull_request")) pull_request = gh_pull_request (p);
+ else if (c (bf, "before")) before = p.next_expect_string ();
else if (c (rp, "repository")) repository = gh_repository (p);
else if (c (in, "installation")) installation = gh_installation (p);
else p.next_expect_value_skip ();
@@ -542,6 +543,7 @@ namespace brep
{
os << "action: " << pr.action;
os << ", pull_request { " << pr.pull_request << " }";
+ os << ", before: " << (pr.before ? *pr.before : "null");
os << ", repository { " << pr.repository << " }";
os << ", installation { " << pr.installation << " }";
diff --git a/mod/mod-ci-github-gh.hxx b/mod/mod-ci-github-gh.hxx
index b29904b..4535622 100644
--- a/mod/mod-ci-github-gh.hxx
+++ b/mod/mod-ci-github-gh.hxx
@@ -183,6 +183,12 @@ namespace brep
string action;
gh_pull_request pull_request;
+
+ // The SHA of the most recent commit on the head branch before the pull
+ // request. Only present if action is "synchronize".
+ //
+ optional<string> before;
+
gh_repository repository;
gh_installation installation;