Repository: openshift-pipelines/pipelines-as-code
Pull request #54 (2021-05-17 07:23:11)

handle issues retest
Support /retest in issue comment.

If we have a /retest made by a allowed to run CI user, in any line in comment
starting with /retest then restart the CI for that PR.

Done at triggers level so we don't spin a pod every time we do the filtering.



Patch:
diff --git a/config/400-triggers.yaml b/config/400-triggers.yaml
index 84dd9301..19ae20f9 100644
--- a/config/400-triggers.yaml
+++ b/config/400-triggers.yaml
@@ -10,7 +10,7 @@ metadata:
 spec:
   serviceAccountName: openshift-pipelines-ascode-sa-el
   triggers:
-    - name: github
+    - name: github-issue-comment-retest
       bindings:
         - ref: openshift-pipelines-ascode-bindings
       interceptors:
@@ -19,11 +19,47 @@ spec:
               secretName: "github-app-secret"
               secretKey: "webhook.secret"
             eventTypes:
-              - pull_request
               - issue_comment
+        - cel:
+            filter: >-
+              body.action == 'created' &&
+              'pull_request' in body.issue &&
+              body.issue.state == 'open' &&
+              body.comment.body.matches('(^|\\r\\n)/retest([ ]*$|$|\\r\\n)')
+      template:
+        ref: openshift-pipelines-ascode-template
+
+    # When using the UI and clicking on Re-run failed test
+    - name: github-check-run-recheck
+      bindings:
+        - ref: openshift-pipelines-ascode-bindings
+      interceptors:
+        - github:
+            secretRef:
+              secretName: "github-app-secret"
+              secretKey: "webhook.secret"
+            eventTypes:
               - check_run
         - cel:
-            filter: "body.action in ['created', 'rerequested', 'opened', 'synchronize'] && 'installation' in body"
+            filter: >-
+              body.action in ['rerequested'] && 'check_run' in body && 'installation' in body
+      template:
+        ref: openshift-pipelines-ascode-template
+
+    # When sending a new Pull Request
+    - name: github-pull-request
+      bindings:
+        - ref: openshift-pipelines-ascode-bindings
+      interceptors:
+        - github:
+            secretRef:
+              secretName: "github-app-secret"
+              secretKey: "webhook.secret"
+            eventTypes:
+              - pull_request
+        - cel:
+            filter: >-
+              body.action in ['created', 'synchronize', 'opened'] && 'installation' in body
       template:
         ref: openshift-pipelines-ascode-template
 
diff --git a/hack/replay-gh-events.py b/hack/replay-gh-events.py
index b17c8915..4d30cba1 100755
--- a/hack/replay-gh-events.py
+++ b/hack/replay-gh-events.py
@@ -68,6 +68,8 @@ def main(args):
         event_type = "pull_request"
     elif jeez["action"] in ("rerequested") and "check_run" in jeez:
         event_type = "check_run"
+    elif jeez["action"] in ("created") and "issue" in jeez:
+        event_type = "issue_comment"
     else:
         raise Exception("Unknown event_type")
 
diff --git a/pkg/cmd/pipelineascode/pipelineascode.go b/pkg/cmd/pipelineascode/pipelineascode.go
index 4b6c18eb..7a5dffc2 100644
--- a/pkg/cmd/pipelineascode/pipelineascode.go
+++ b/pkg/cmd/pipelineascode/pipelineascode.go
@@ -59,7 +59,8 @@ func Command(p cli.Params) *cobra.Command {
 	cmd.Flags().StringVarP(&opts.RunInfo.Owner, "webhook-owner", "", os.Getenv("PAC_OWNER"), "Owner of the of the repository to test")
 	cmd.Flags().StringVarP(&opts.RunInfo.Repository, "webhook-repository", "", os.Getenv("PAC_REPOSITORY_NAME"), "Repository Name of the repository to test")
 	cmd.Flags().StringVarP(&opts.RunInfo.DefaultBranch, "webhook-defaultbranch", "", os.Getenv("PAC_DEFAULTBRANCH"), "DefaultBranch of the repository to test")
-	cmd.Flags().StringVarP(&opts.RunInfo.Branch, "webhook-target-branch", "", os.Getenv("PAC_BRANCH"), "Target branch of the repository to test")
+	cmd.Flags().StringVarP(&opts.RunInfo.BaseBranch, "webhook-base-branch", "", os.Getenv("PAC_BASE_BRANCH"), "Base branch from where the SHA is based ie: main")
+	cmd.Flags().StringVarP(&opts.RunInfo.HeadBranch, "webhook-head-branch", "", os.Getenv("PAC_HEAD_BRANCH"), "Head branch of the SHA ie: pr")
 	cmd.Flags().StringVarP(&opts.RunInfo.Sender, "webhook-sender", "", os.Getenv("PAC_Sender"), "Sender for the commit/pr")
 	cmd.Flags().StringVarP(&opts.RunInfo.URL, "webhook-url", "", os.Getenv("PAC_URL"), "URL of the repository to test")
 	cmd.Flags().StringVarP(&opts.RunInfo.EventType, "webhook-type", "", os.Getenv("PAC_EVENT_TYPE"), "Payload event type as set from Github")
diff --git a/pkg/pipelineascode/pipelineascode.go b/pkg/pipelineascode/pipelineascode.go
index 717326b2..b573fa2d 100644
--- a/pkg/pipelineascode/pipelineascode.go
+++ b/pkg/pipelineascode/pipelineascode.go
@@ -84,7 +84,7 @@ func Run(cs *cli.Clients, k8int cli.KubeInteractionIntf, runinfo *webvcs.RunInfo
 			return err
 		}
 	}
-	repo, err := getRepoByCR(cs, runinfo.URL, runinfo.Branch, maintekton.Namespace)
+	repo, err := getRepoByCR(cs, runinfo.URL, runinfo.BaseBranch, maintekton.Namespace)
 	if err != nil {
 		return err
 	}
@@ -92,7 +92,7 @@ func Run(cs *cli.Clients, k8int cli.KubeInteractionIntf, runinfo *webvcs.RunInfo
 	if repo.Spec.Namespace == "" {
 		_, _ = cs.GithubClient.CreateStatus(runinfo, "completed", "skipped",
 			"Could not find a configuration for this repository", "https://tenor.com/search/sad-cat-gifs")
-		cs.Log.Infof("Could not find a namespace match for %s/%s on %s", runinfo.Owner, runinfo.Repository, runinfo.Branch)
+		cs.Log.Infof("Could not find a namespace match for %s/%s on %s", runinfo.Owner, runinfo.Repository, runinfo.BaseBranch)
 		return nil
 	}
 
@@ -104,7 +104,7 @@ func Run(cs *cli.Clients, k8int cli.KubeInteractionIntf, runinfo *webvcs.RunInfo
 	}
 	cs.Log.Infow("Loading payload",
 		"url", runinfo.URL,
-		"branch", runinfo.Branch,
+		"branch", runinfo.BaseBranch,
 		"sha", runinfo.SHA,
 		"event_type", "pull_request")
 
@@ -163,7 +163,7 @@ func Run(cs *cli.Clients, k8int cli.KubeInteractionIntf, runinfo *webvcs.RunInfo
 		"tekton.dev/pipeline-ascode-repository": runinfo.Repository,
 		"tekton.dev/pipeline-ascode-sha":        runinfo.SHA,
 		"tekton.dev/pipeline-ascode-sender":     runinfo.Sender,
-		"tekton.dev/pipeline-ascode-branch":     runinfo.Branch,
+		"tekton.dev/pipeline-ascode-branch":     runinfo.BaseBranch,
 	}
 
 	ctx := context.Background()
diff --git a/pkg/webvcs/github.go b/pkg/webvcs/github.go
index 7f51844b..59013e41 100644
--- a/pkg/webvcs/github.go
+++ b/pkg/webvcs/github.go
@@ -7,6 +7,8 @@ import (
 	"errors"
 	"fmt"
 	"net/http"
+	"path"
+	"strconv"
 	"strings"
 	"time"
 
@@ -21,9 +23,10 @@ type GithubVCS struct {
 }
 
 type RunInfo struct {
-	Branch        string
-	CheckRunID    *int64
+	BaseBranch    string // branch against where we are making the PR
+	HeadBranch    string // branch from where our SHA get tested
 	DefaultBranch string
+	CheckRunID    *int64
 	EventType     string
 	Owner         string
 	Repository    string
@@ -34,10 +37,10 @@ type RunInfo struct {
 }
 
 func (r RunInfo) Check() error {
-	if r.SHA != "" && r.Branch != "" &&
+	if r.SHA != "" && r.BaseBranch != "" &&
 		r.Repository != "" && r.DefaultBranch != "" &&
-		r.Owner != "" && r.URL != "" && r.Sender != "" &&
-		r.EventType != "" {
+		r.HeadBranch != "" && r.Owner != "" && r.URL != "" &&
+		r.Sender != "" && r.EventType != "" {
 		return nil
 	}
 	return fmt.Errorf("missing values in runInfo")
@@ -60,7 +63,7 @@ func NewGithubVCS(token string) GithubVCS {
 	}
 }
 
-// We got a bunch of \r\n or \n and others from triggers/github, so let just
+// payloadFix since we are getting a bunch of \r\n or \n and others from triggers/github, so let just
 // workaround it. Originally from https://stackoverflow.com/a/52600147
 func payloadFix(payload string) string {
 	replacement := " "
@@ -84,11 +87,37 @@ func (v GithubVCS) handleReRequestEvent(log *zap.SugaredLogger, event *github.Ch
 	}
 	prNumber := event.GetCheckRun().GetCheckSuite().PullRequests[0].GetNumber()
 	log.Infof("Recheck of PR %s/%s#%d has been requested", runinfo.Owner, runinfo.Repository, prNumber)
+	return v.getPullRequest(runinfo, prNumber)
+}
+
+func (v GithubVCS) handleIssueCommentEvent(log *zap.SugaredLogger, event *github.IssueCommentEvent) (RunInfo, error) {
+	runinfo := RunInfo{
+		Owner:      event.GetRepo().GetOwner().GetLogin(),
+		Repository: event.GetRepo().GetName(),
+	}
+	if !event.GetIssue().IsPullRequest() {
+		return RunInfo{}, fmt.Errorf("issue comment is not coming from a pull_request")
+	}
+
+	// We are getting the full URL so we have to get the last part to get the PR number,
+	// we don't have to care about URL query string/hash and other stuff because
+	// that comes up from the API.
+	prNumber, err := strconv.Atoi(path.Base(event.GetIssue().GetPullRequestLinks().GetHTMLURL()))
+	if err != nil {
+		return RunInfo{}, err
+	}
+
+	log.Infof("PR recheck from issue commment on %s/%s#%d has been requested", runinfo.Owner, runinfo.Repository, prNumber)
+	return v.getPullRequest(runinfo, prNumber)
+}
+
+// getPullRequest get a pull request details
+func (v GithubVCS) getPullRequest(runinfo RunInfo, prNumber int) (RunInfo, error) {
 	pr, _, err := v.Client.PullRequests.Get(context.Background(), runinfo.Owner, runinfo.Repository, prNumber)
 	if err != nil {
 		return runinfo, err
 	}
-	// Make sure to use the Base for Default Branch or there would be a potential hijack
+	// Make sure to use the Base for Default BaseBranch or there would be a potential hijack
 	runinfo.DefaultBranch = pr.GetBase().GetRepo().GetDefaultBranch()
 	runinfo.URL = pr.GetBase().GetRepo().GetHTMLURL()
 	runinfo.SHA = pr.GetHead().GetSHA()
@@ -96,7 +125,8 @@ func (v GithubVCS) handleReRequestEvent(log *zap.SugaredLogger, event *github.Ch
 	// would use the CheckRun Sender instead of the rerequest sender, could it
 	// be a room for abuse? 🤔
 	runinfo.Sender = pr.GetUser().GetLogin()
-	runinfo.Branch = pr.GetHead().GetRef()
+	runinfo.HeadBranch = pr.GetHead().GetRef()
+	runinfo.BaseBranch = pr.GetBase().GetRef()
 	return runinfo, nil
 }
 
@@ -120,6 +150,12 @@ func (v GithubVCS) ParsePayload(log *zap.SugaredLogger, eventType, payload strin
 			if err != nil {
 				return &runinfo, err
 			}
+
+		}
+	case *github.IssueCommentEvent:
+		runinfo, err = v.handleIssueCommentEvent(log, event)
+		if err != nil {
+			return &runinfo, err
 		}
 	case *github.PullRequestEvent:
 		runinfo = RunInfo{
@@ -128,7 +164,8 @@ func (v GithubVCS) ParsePayload(log *zap.SugaredLogger, eventType, payload strin
 			DefaultBranch: event.GetRepo().GetDefaultBranch(),
 			SHA:           event.GetPullRequest().Head.GetSHA(),
 			URL:           event.GetRepo().GetHTMLURL(),
-			Branch:        event.GetPullRequest().Base.GetRef(),
+			BaseBranch:    event.GetPullRequest().Base.GetRef(),
+			HeadBranch:    event.GetPullRequest().Head.GetRef(),
 			Sender:        event.GetPullRequest().GetUser().GetLogin(),
 		}
 	default:
@@ -147,7 +184,7 @@ func (v GithubVCS) CheckSenderOrgMembership(runinfo *RunInfo) (bool, error) {
 		})
 
 	// If we are 404 it means we are checking a repo owner and not a org so let's bail out with grace
-	if resp.Response.StatusCode == http.StatusNotFound {
+	if resp != nil && resp.Response.StatusCode == http.StatusNotFound {
 		return false, nil
 	}
 
@@ -170,7 +207,7 @@ func (v GithubVCS) GetTektonDir(path string, runinfo *RunInfo) ([]*github.Reposi
 	if fp != nil {
 		return nil, fmt.Errorf("the object %s is a file instead of a directory", path)
 	}
-	if resp.Response.StatusCode == http.StatusNotFound {
+	if resp != nil && resp.Response.StatusCode == http.StatusNotFound {
 		return nil, nil
 	}
 
@@ -182,11 +219,11 @@ func (v GithubVCS) GetTektonDir(path string, runinfo *RunInfo) ([]*github.Reposi
 }
 
 // GetFileInsideRepo Get a file via Github API using the runinfo information, we
-// branch is true, the user the branch as ref isntead of the SHA
+// branch is true, the user the branch as ref instead of the SHA
 func (v GithubVCS) GetFileInsideRepo(path string, branch bool, runinfo *RunInfo) (string, error) {
 	ref := runinfo.SHA
 	if branch {
-		ref = runinfo.Branch
+		ref = runinfo.BaseBranch
 	}
 
 	fp, objects, resp, err := v.Client.Repositories.GetContents(v.Context, runinfo.Owner,
@@ -209,16 +246,16 @@ func (v GithubVCS) GetFileInsideRepo(path string, branch bool, runinfo *RunInfo)
 	return string(getobj), nil
 }
 
-// GetFileFromDefaultBranch will get a file directly from the Default Branch as
+// GetFileFromDefaultBranch will get a file directly from the Default BaseBranch as
 // configured in runinfo which is directly set in webhook by Github
 func (v GithubVCS) GetFileFromDefaultBranch(path string, runinfo *RunInfo) (string, error) {
 	runInfoOnMain := &RunInfo{}
 	runinfo.DeepCopyInto(runInfoOnMain)
-	runInfoOnMain.Branch = runInfoOnMain.DefaultBranch
+	runInfoOnMain.BaseBranch = runInfoOnMain.DefaultBranch
 
 	tektonyaml, err := v.GetFileInsideRepo(path, true, runInfoOnMain)
 	if err != nil {
-		return "", fmt.Errorf("cannot find %s inside the %s branch: %s", path, runInfoOnMain.Branch, err)
+		return "", fmt.Errorf("cannot find %s inside the %s branch: %s", path, runInfoOnMain.BaseBranch, err)
 	}
 	return tektonyaml, err
 }


Test patch:
diff --git a/pkg/cmd/pipelineascode/pipelineascode_test.go b/pkg/cmd/pipelineascode/pipelineascode_test.go
index 782d499e..24a5a698 100644
--- a/pkg/cmd/pipelineascode/pipelineascode_test.go
+++ b/pkg/cmd/pipelineascode/pipelineascode_test.go
@@ -72,8 +72,9 @@ func TestGetInfo(t *testing.T) {
 		Repository:    "bar",
 		DefaultBranch: "main",
 		SHA:           "d0d0",
-		URL:           "http://chmouel.com",
-		Branch:        "goodRuninfoBranch",
+		URL:           "https://chmouel.com",
+		BaseBranch:    "goodRuninfoBranch",
+		HeadBranch:    "headRunInfoBranch",
 		Sender:        "ElSender",
 		EventType:     "pull_request",
 	}
@@ -155,7 +156,7 @@ func TestGetInfo(t *testing.T) {
 				assert.ErrorContains(t, err, tC.errmsg)
 			} else {
 				assert.NilError(t, err)
-				assert.Equal(t, runinfo.Branch, tC.branchShouldBe)
+				assert.Equal(t, runinfo.BaseBranch, tC.branchShouldBe)
 			}
 		})
 	}
diff --git a/pkg/pipelineascode/pipelineascode_test.go b/pkg/pipelineascode/pipelineascode_test.go
index d2bca731..6ff0470e 100644
--- a/pkg/pipelineascode/pipelineascode_test.go
+++ b/pkg/pipelineascode/pipelineascode_test.go
@@ -169,11 +169,12 @@ func TestRunDeniedFromForcedNamespace(t *testing.T) {
 	forcedNamespace := "laotronamspace"
 	installedNamespace := "nomespace"
 	runinfo := &webvcs.RunInfo{
-		SHA:           "principale",
+		SHA:           "sha",
 		Owner:         "organizatione",
 		Repository:    "repo",
 		URL:           "https://service/documentation",
-		Branch:        "press",
+		HeadBranch:    "press",
+		BaseBranch:    "main",
 		DefaultBranch: defaultBranch,
 		Sender:        "carlos_valderama",
 	}
@@ -206,7 +207,7 @@ func TestRunDeniedFromForcedNamespace(t *testing.T) {
 	}
 	datas := testclient.Data{
 		Repositories: []*v1alpha1.Repository{
-			newRepo("repo", runinfo.URL, runinfo.Branch, installedNamespace, installedNamespace),
+			newRepo("repo", runinfo.URL, runinfo.BaseBranch, installedNamespace, installedNamespace),
 		},
 	}
 	stdata, _ := testclient.SeedTestData(t, ctx, datas)
@@ -232,7 +233,8 @@ func TestRun(t *testing.T) {
 		Owner:      "organizationes",
 		Repository: "lagaffe",
 		URL:        "https://service/documentation",
-		Branch:     "press",
+		HeadBranch: "press",
+		BaseBranch: "main",
 		Sender:     "fantasio",
 	}
 
@@ -336,7 +338,7 @@ func TestRun(t *testing.T) {
 			newRepo(
 				"test-run",
 				runinfo.URL,
-				runinfo.Branch,
+				runinfo.BaseBranch,
 				"namespace",
 				"namespace"),
 		},
diff --git a/pkg/webvcs/github_test.go b/pkg/webvcs/github_test.go
index 37de4b38..ff26ad79 100644
--- a/pkg/webvcs/github_test.go
+++ b/pkg/webvcs/github_test.go
@@ -11,6 +11,7 @@ import (
 	"testing"
 
 	ghtesthelper "github.com/openshift-pipelines/pipelines-as-code/pkg/test/github"
+	rtesting "knative.dev/pkg/reconciler/testing"
 
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-github/v34/github"
@@ -25,83 +26,6 @@ func getLogger() (*zap.SugaredLogger, *zapobserver.ObservedLogs) {
 	return logger, logobserver
 }
 
-func TestPayLoadFix(t *testing.T) {
-	b, err := ioutil.ReadFile("testdata/pull_request_with_newlines.json")
-	assert.NilError(t, err)
-	gvcs := NewGithubVCS("none")
-	logger, _ := getLogger()
-	_, err = gvcs.ParsePayload(logger, "pull_request", payloadFix(string(b)))
-	// would bomb out on "assertion failed: error is not nil: invalid character
-	// '\n' in string literal" if we don't payloadfix
-	assert.NilError(t, err)
-}
-
-func TestParsePayloadRerequest(t *testing.T) {
-	checkrunSender := "jean-pierre"
-	prOwner := "openshift"
-	repoName := "pipelines"
-	prNumber := "123"
-	checkrunEvent := fmt.Sprintf(`{"action": "rerequested", 
-	"sender": {"login": "%s"},
-	"check_run": {"check_suite": {"pull_requests": [{"number": %s}]}}, 
-	"repository": {"name": "%s", "owner": {"login": "%s"}}}`,
-		checkrunSender, prNumber, repoName, prOwner)
-	fakeclient, mux, _, teardown := ghtesthelper.SetupGH()
-	defer teardown()
-	mux.HandleFunc("/repos/"+prOwner+"/"+repoName+"/pulls/"+prNumber, func(rw http.ResponseWriter, r *http.Request) {
-		fmt.Fprintf(rw, `{"head": {"ref": "123"}, "user": {"login": "%s"}}`, prOwner)
-	})
-	gvcs := GithubVCS{
-		Client:  fakeclient,
-		Context: context.Background(),
-	}
-	logger, observer := getLogger()
-	runinfo, err := gvcs.ParsePayload(logger, "check_run", checkrunEvent)
-	assert.NilError(t, err)
-
-	assert.Equal(t, prOwner, runinfo.Owner)
-	assert.Equal(t, repoName, runinfo.Repository)
-	assert.Assert(t, checkrunSender != runinfo.Sender)
-
-	assert.Assert(t, strings.Contains(observer.TakeAll()[0].Message, "Recheck of PR"))
-}
-
-func TestParsePayload(t *testing.T) {
-	b, err := ioutil.ReadFile("testdata/pull_request.json")
-	assert.NilError(t, err)
-
-	gvcs := NewGithubVCS("none")
-	logger, _ := getLogger()
-
-	runinfo, err := gvcs.ParsePayload(logger, "pull_request", string(b))
-	assert.NilError(t, err)
-	assert.Assert(t, runinfo.Branch == "master")
-	assert.Assert(t, runinfo.Owner == "chmouel")
-	assert.Assert(t, runinfo.Repository == "scratchpad")
-	assert.Assert(t, runinfo.URL == "https://github.com/chmouel/scratchpad")
-}
-
-func TestParsePayloadInvalid(t *testing.T) {
-	gvcs := NewGithubVCS("none")
-	logger, _ := getLogger()
-	_, err := gvcs.ParsePayload(logger, "pull_request", "hello moto")
-	assert.ErrorContains(t, err, "invalid character")
-}
-
-func TestParsePayloadUnkownEvent(t *testing.T) {
-	gvcs := NewGithubVCS("none")
-	logger, _ := getLogger()
-	_, err := gvcs.ParsePayload(logger, "foo", "{\"hello\": \"moto\"}")
-	assert.ErrorContains(t, err, "unknown X-Github-Event")
-}
-
-func TestParsePayCannotParse(t *testing.T) {
-	gvcs := NewGithubVCS("none")
-	logger, _ := getLogger()
-	_, err := gvcs.ParsePayload(logger, "gollum", "{}")
-	assert.Error(t, err, "this event is not supported")
-}
-
 func setupFakesURLS() (client GithubVCS, teardown func()) {
 	fakeclient, mux, _, teardown := ghtesthelper.SetupGH()
 
@@ -198,6 +122,129 @@ func setupFakesURLS() (client GithubVCS, teardown func()) {
 	return gcvs, teardown
 }
 
+func TestPayLoadFix(t *testing.T) {
+	b, err := ioutil.ReadFile("testdata/pull_request_with_newlines.json")
+	assert.NilError(t, err)
+	gvcs := NewGithubVCS("none")
+	logger, _ := getLogger()
+	_, err = gvcs.ParsePayload(logger, "pull_request", payloadFix(string(b)))
+	// would bomb out on "assertion failed: error is not nil: invalid character
+	// '\n' in string literal" if we don't payloadfix
+	assert.NilError(t, err)
+}
+
+func TestParsePayloadRerequest(t *testing.T) {
+	checkrunSender := "jean-pierre"
+	prOwner := "openshift"
+	repoName := "pipelines"
+	prNumber := "123"
+	checkrunEvent := fmt.Sprintf(`{"action": "rerequested", 
+	"sender": {"login": "%s"},
+	"check_run": {"check_suite": {"pull_requests": [{"number": %s}]}}, 
+	"repository": {"name": "%s", "owner": {"login": "%s"}}}`,
+		checkrunSender, prNumber, repoName, prOwner)
+	fakeclient, mux, _, teardown := ghtesthelper.SetupGH()
+	defer teardown()
+	mux.HandleFunc("/repos/"+prOwner+"/"+repoName+"/pulls/"+prNumber, func(rw http.ResponseWriter, r *http.Request) {
+		fmt.Fprintf(rw, `{"head": {"ref": "123"}, "user": {"login": "%s"}}`, prOwner)
+	})
+	gvcs := GithubVCS{
+		Client:  fakeclient,
+		Context: context.Background(),
+	}
+	logger, observer := getLogger()
+	runinfo, err := gvcs.ParsePayload(logger, "check_run", checkrunEvent)
+	assert.NilError(t, err)
+
+	assert.Equal(t, prOwner, runinfo.Owner)
+	assert.Equal(t, repoName, runinfo.Repository)
+	assert.Assert(t, checkrunSender != runinfo.Sender)
+
+	assert.Assert(t, strings.Contains(observer.TakeAll()[0].Message, "Recheck of PR"))
+}
+
+func TestParsePayLoadRetest(t *testing.T) {
+	issueSender := "tartanpion"
+	prOwner := "user1"
+	repoOwner := "openshift"
+	repoName := "pipelines"
+	prNumber := "123"
+
+	fakeclient, mux, _, teardown := ghtesthelper.SetupGH()
+	defer teardown()
+	mux.HandleFunc("/repos/"+prOwner+"/"+repoName+"/pulls/"+prNumber, func(rw http.ResponseWriter, r *http.Request) {
+		fmt.Fprintf(rw, `{"head": {"ref": "123"}, "user": {"login": "%s"}}`, prOwner)
+	})
+
+	issueEvent := fmt.Sprintf(`{
+  "sender": {
+    "login": "%s"
+  },
+  "repository": {
+    "name": "%s",
+    "owner": {
+      "login": "%s"
+    }
+  },
+  "issue": {
+    "pull_request": {
+      "html_url": "https://github.com/%s/%s/pull/%s"
+    }
+  }
+}`, issueSender, repoName, prOwner, repoName, repoOwner, prNumber)
+
+	ctx, _ := rtesting.SetupFakeContext(t)
+	logger, observer := getLogger()
+	gvcs := GithubVCS{
+		Client:  fakeclient,
+		Context: ctx,
+	}
+
+	runinfo, err := gvcs.ParsePayload(logger, "issue_comment", issueEvent)
+	assert.NilError(t, err)
+	assert.Equal(t, prOwner, runinfo.Owner)
+	// Make sure the PR owner is the runinfo.Owner and not the issueSender
+	assert.Assert(t, issueSender != runinfo.Owner)
+	firstObservedMessage := observer.TakeAll()[0].Message
+	assert.Assert(t, strings.Contains(firstObservedMessage, "recheck"))
+}
+
+func TestParsePayload(t *testing.T) {
+	b, err := ioutil.ReadFile("testdata/pull_request.json")
+	assert.NilError(t, err)
+
+	gvcs := NewGithubVCS("none")
+	logger, _ := getLogger()
+
+	runinfo, err := gvcs.ParsePayload(logger, "pull_request", string(b))
+	assert.NilError(t, err)
+	assert.Assert(t, runinfo.BaseBranch == "master")
+	assert.Assert(t, runinfo.Owner == "chmouel")
+	assert.Assert(t, runinfo.Repository == "scratchpad")
+	assert.Assert(t, runinfo.URL == "https://github.com/chmouel/scratchpad")
+}
+
+func TestParsePayloadInvalid(t *testing.T) {
+	gvcs := NewGithubVCS("none")
+	logger, _ := getLogger()
+	_, err := gvcs.ParsePayload(logger, "pull_request", "hello moto")
+	assert.ErrorContains(t, err, "invalid character")
+}
+
+func TestParsePayloadUnkownEvent(t *testing.T) {
+	gvcs := NewGithubVCS("none")
+	logger, _ := getLogger()
+	_, err := gvcs.ParsePayload(logger, "foo", "{\"hello\": \"moto\"}")
+	assert.ErrorContains(t, err, "unknown X-Github-Event")
+}
+
+func TestParsePayCannotParse(t *testing.T) {
+	gvcs := NewGithubVCS("none")
+	logger, _ := getLogger()
+	_, err := gvcs.ParsePayload(logger, "gollum", "{}")
+	assert.Error(t, err, "this event is not supported")
+}
+
 func TestGetFileInsideRepo(t *testing.T) {
 	gcvs, teardown := setupFakesURLS()
 	defer teardown()
@@ -394,9 +441,10 @@ func TestRunInfoCheck(t *testing.T) {
 		DefaultBranch string
 		SHA           string
 		URL           string
-		Branch        string
 		Sender        string
 		CheckRunID    *int64
+		BaseBranch    string
+		HeadBranch    string
 	}
 	tests := []struct {
 		name    string
@@ -416,8 +464,9 @@ func TestRunInfoCheck(t *testing.T) {
 				DefaultBranch: "default",
 				SHA:           "1d1",
 				URL:           "https://anywhere",
-				Branch:        "main",
+				BaseBranch:    "main",
 				Sender:        "beeboo",
+				HeadBranch:    "pr",
 			},
 			wantErr: false,
 		},
@@ -430,7 +479,8 @@ func TestRunInfoCheck(t *testing.T) {
 				DefaultBranch: tt.fields.DefaultBranch,
 				SHA:           tt.fields.SHA,
 				URL:           tt.fields.URL,
-				Branch:        tt.fields.Branch,
+				BaseBranch:    tt.fields.BaseBranch,
+				HeadBranch:    tt.fields.HeadBranch,
 				CheckRunID:    tt.fields.CheckRunID,
 				Sender:        tt.fields.Sender,
 				EventType:     "pull_request",
diff --git a/test/fixtures/issue_comment.json b/test/fixtures/issue_comment.json
index c416961a..29b7ad2a 100644
--- a/test/fixtures/issue_comment.json
+++ b/test/fixtures/issue_comment.json
@@ -1,46 +1,38 @@
 {
   "action": "created",
   "issue": {
-    "url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/639",
-    "repository_url": "https://api.github.com/repos/openshift/tektoncd-pipeline",
-    "labels_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/639/labels{/name}",
-    "comments_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/639/comments",
-    "events_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/639/events",
-    "html_url": "https://github.com/openshift/tektoncd-pipeline/pull/639",
-    "id": 848877667,
-    "node_id": "MDExOlB1bGxSZXF1ZXN0NjA3NzQ1Mjc1",
-    "number": 639,
-    "title": ":robot: Triggering CI on branch 'release-next' after synching to upstream/master",
+    "url": "https://api.github.com/repos/chmouel/scratchmyback/issues/1",
+    "repository_url": "https://api.github.com/repos/chmouel/scratchmyback",
+    "labels_url": "https://api.github.com/repos/chmouel/scratchmyback/issues/1/labels{/name}",
+    "comments_url": "https://api.github.com/repos/chmouel/scratchmyback/issues/1/comments",
+    "events_url": "https://api.github.com/repos/chmouel/scratchmyback/issues/1/events",
+    "html_url": "https://github.com/chmouel/scratchmyback/pull/1",
+    "id": 860639914,
+    "node_id": "MDExOlB1bGxSZXF1ZXN0NjE3NDY3NjE2",
+    "number": 1,
+    "title": "Add tekton ci",
     "user": {
-      "login": "alanfx",
-      "id": 3027310,
-      "node_id": "MDQ6VXNlcjMwMjczMTA=",
-      "avatar_url": "https://avatars.githubusercontent.com/u/3027310?v=4",
+      "login": "chmouel",
+      "id": 98980,
+      "node_id": "MDQ6VXNlcjk4OTgw",
+      "avatar_url": "https://avatars.githubusercontent.com/u/98980?v=4",
       "gravatar_id": "",
-      "url": "https://api.github.com/users/alanfx",
-      "html_url": "https://github.com/alanfx",
-      "followers_url": "https://api.github.com/users/alanfx/followers",
-      "following_url": "https://api.github.com/users/alanfx/following{/other_user}",
-      "gists_url": "https://api.github.com/users/alanfx/gists{/gist_id}",
-      "starred_url": "https://api.github.com/users/alanfx/starred{/owner}{/repo}",
-      "subscriptions_url": "https://api.github.com/users/alanfx/subscriptions",
-      "organizations_url": "https://api.github.com/users/alanfx/orgs",
-      "repos_url": "https://api.github.com/users/alanfx/repos",
-      "events_url": "https://api.github.com/users/alanfx/events{/privacy}",
-      "received_events_url": "https://api.github.com/users/alanfx/received_events",
+      "url": "https://api.github.com/users/chmouel",
+      "html_url": "https://github.com/chmouel",
+      "followers_url": "https://api.github.com/users/chmouel/followers",
+      "following_url": "https://api.github.com/users/chmouel/following{/other_user}",
+      "gists_url": "https://api.github.com/users/chmouel/gists{/gist_id}",
+      "starred_url": "https://api.github.com/users/chmouel/starred{/owner}{/repo}",
+      "subscriptions_url": "https://api.github.com/users/chmouel/subscriptions",
+      "organizations_url": "https://api.github.com/users/chmouel/orgs",
+      "repos_url": "https://api.github.com/users/chmouel/repos",
+      "events_url": "https://api.github.com/users/chmouel/events{/privacy}",
+      "received_events_url": "https://api.github.com/users/chmouel/received_events",
       "type": "User",
       "site_admin": false
     },
     "labels": [
-      {
-        "id": 1364599670,
-        "node_id": "MDU6TGFiZWwxMzY0NTk5Njcw",
-        "url": "https://api.github.com/repos/openshift/tektoncd-pipeline/labels/kind/sync-fork-to-upstream",
-        "name": "kind/sync-fork-to-upstream",
-        "color": "c7def8",
-        "default": false,
-        "description": ""
-      }
+
     ],
     "state": "open",
     "locked": false,
@@ -49,189 +41,175 @@
 
     ],
     "milestone": null,
-    "comments": 2,
-    "created_at": "2021-04-02T00:41:39Z",
-    "updated_at": "2021-04-02T02:50:44Z",
+    "comments": 1,
+    "created_at": "2021-04-18T11:26:57Z",
+    "updated_at": "2021-05-13T11:55:33Z",
     "closed_at": null,
-    "author_association": "NONE",
+    "author_association": "OWNER",
     "active_lock_reason": null,
     "pull_request": {
-      "url": "https://api.github.com/repos/openshift/tektoncd-pipeline/pulls/639",
-      "html_url": "https://github.com/openshift/tektoncd-pipeline/pull/639",
-      "diff_url": "https://github.com/openshift/tektoncd-pipeline/pull/639.diff",
-      "patch_url": "https://github.com/openshift/tektoncd-pipeline/pull/639.patch"
+      "url": "https://api.github.com/repos/chmouel/scratchmyback/pulls/1",
+      "html_url": "https://github.com/chmouel/scratchmyback/pull/1",
+      "diff_url": "https://github.com/chmouel/scratchmyback/pull/1.diff",
+      "patch_url": "https://github.com/chmouel/scratchmyback/pull/1.patch"
     },
-    "body": null,
+    "body": "Signed-off-by: Chmouel Boudjnah <chmouel@chmouel.com>",
     "performed_via_github_app": null
   },
   "comment": {
-    "url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/comments/812288053",
-    "html_url": "https://github.com/openshift/tektoncd-pipeline/pull/639#issuecomment-812288053",
-    "issue_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/639",
-    "id": 812288053,
-    "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjI4ODA1Mw==",
+    "url": "https://api.github.com/repos/chmouel/scratchmyback/issues/comments/840508083",
+    "html_url": "https://github.com/chmouel/scratchmyback/pull/1#issuecomment-840508083",
+    "issue_url": "https://api.github.com/repos/chmouel/scratchmyback/issues/1",
+    "id": 840508083,
+    "node_id": "MDEyOklzc3VlQ29tbWVudDg0MDUwODA4Mw==",
     "user": {
-      "login": "alanfx",
-      "id": 3027310,
-      "node_id": "MDQ6VXNlcjMwMjczMTA=",
-      "avatar_url": "https://avatars.githubusercontent.com/u/3027310?v=4",
+      "login": "chmouel",
+      "id": 98980,
+      "node_id": "MDQ6VXNlcjk4OTgw",
+      "avatar_url": "https://avatars.githubusercontent.com/u/98980?v=4",
       "gravatar_id": "",
-      "url": "https://api.github.com/users/alanfx",
-      "html_url": "https://github.com/alanfx",
-      "followers_url": "https://api.github.com/users/alanfx/followers",
-      "following_url": "https://api.github.com/users/alanfx/following{/other_user}",
-      "gists_url": "https://api.github.com/users/alanfx/gists{/gist_id}",
-      "starred_url": "https://api.github.com/users/alanfx/starred{/owner}{/repo}",
-      "subscriptions_url": "https://api.github.com/users/alanfx/subscriptions",
-      "organizations_url": "https://api.github.com/users/alanfx/orgs",
-      "repos_url": "https://api.github.com/users/alanfx/repos",
-      "events_url": "https://api.github.com/users/alanfx/events{/privacy}",
-      "received_events_url": "https://api.github.com/users/alanfx/received_events",
+      "url": "https://api.github.com/users/chmouel",
+      "html_url": "https://github.com/chmouel",
+      "followers_url": "https://api.github.com/users/chmouel/followers",
+      "following_url": "https://api.github.com/users/chmouel/following{/other_user}",
+      "gists_url": "https://api.github.com/users/chmouel/gists{/gist_id}",
+      "starred_url": "https://api.github.com/users/chmouel/starred{/owner}{/repo}",
+      "subscriptions_url": "https://api.github.com/users/chmouel/subscriptions",
+      "organizations_url": "https://api.github.com/users/chmouel/orgs",
+      "repos_url": "https://api.github.com/users/chmouel/repos",
+      "events_url": "https://api.github.com/users/chmouel/events{/privacy}",
+      "received_events_url": "https://api.github.com/users/chmouel/received_events",
       "type": "User",
       "site_admin": false
     },
-    "created_at": "2021-04-02T02:50:44Z",
-    "updated_at": "2021-04-02T02:50:44Z",
-    "author_association": "NONE",
-      "body": "Hello world\n\n/retest\n\n<!-- probot = {\"1562\":{\"snooze\":{\"who\":\"bkeepers\",\"what\":\"call mom\",\"when\":\"2017-09-11T16:38:05.000Z\"}}} -->",
+    "created_at": "2021-05-13T11:55:33Z",
+    "updated_at": "2021-05-13T11:55:33Z",
+    "author_association": "OWNER",
+    "body": "/retest",
     "performed_via_github_app": null
   },
   "repository": {
-    "id": 161837529,
-    "node_id": "MDEwOlJlcG9zaXRvcnkxNjE4Mzc1Mjk=",
-    "name": "tektoncd-pipeline",
-    "full_name": "openshift/tektoncd-pipeline",
+    "id": 359117785,
+    "node_id": "MDEwOlJlcG9zaXRvcnkzNTkxMTc3ODU=",
+    "name": "scratchmyback",
+    "full_name": "chmouel/scratchmyback",
     "private": false,
     "owner": {
-      "login": "openshift",
-      "id": 792337,
-      "node_id": "MDEyOk9yZ2FuaXphdGlvbjc5MjMzNw==",
-      "avatar_url": "https://avatars.githubusercontent.com/u/792337?v=4",
+      "login": "chmouel",
+      "id": 98980,
+      "node_id": "MDQ6VXNlcjk4OTgw",
+      "avatar_url": "https://avatars.githubusercontent.com/u/98980?v=4",
       "gravatar_id": "",
-      "url": "https://api.github.com/users/openshift",
-      "html_url": "https://github.com/openshift",
-      "followers_url": "https://api.github.com/users/openshift/followers",
-      "following_url": "https://api.github.com/users/openshift/following{/other_user}",
-      "gists_url": "https://api.github.com/users/openshift/gists{/gist_id}",
-      "starred_url": "https://api.github.com/users/openshift/starred{/owner}{/repo}",
-      "subscriptions_url": "https://api.github.com/users/openshift/subscriptions",
-      "organizations_url": "https://api.github.com/users/openshift/orgs",
-      "repos_url": "https://api.github.com/users/openshift/repos",
-      "events_url": "https://api.github.com/users/openshift/events{/privacy}",
-      "received_events_url": "https://api.github.com/users/openshift/received_events",
-      "type": "Organization",
+      "url": "https://api.github.com/users/chmouel",
+      "html_url": "https://github.com/chmouel",
+      "followers_url": "https://api.github.com/users/chmouel/followers",
+      "following_url": "https://api.github.com/users/chmouel/following{/other_user}",
+      "gists_url": "https://api.github.com/users/chmouel/gists{/gist_id}",
+      "starred_url": "https://api.github.com/users/chmouel/starred{/owner}{/repo}",
+      "subscriptions_url": "https://api.github.com/users/chmouel/subscriptions",
+      "organizations_url": "https://api.github.com/users/chmouel/orgs",
+      "repos_url": "https://api.github.com/users/chmouel/repos",
+      "events_url": "https://api.github.com/users/chmouel/events{/privacy}",
+      "received_events_url": "https://api.github.com/users/chmouel/received_events",
+      "type": "User",
       "site_admin": false
     },
-    "html_url": "https://github.com/openshift/tektoncd-pipeline",
-    "description": "A K8s-native Pipeline resource.",
-    "fork": true,
-    "url": "https://api.github.com/repos/openshift/tektoncd-pipeline",
-    "forks_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/forks",
-    "keys_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/keys{/key_id}",
-    "collaborators_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/collaborators{/collaborator}",
-    "teams_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/teams",
-    "hooks_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/hooks",
-    "issue_events_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/events{/number}",
-    "events_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/events",
-    "assignees_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/assignees{/user}",
-    "branches_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/branches{/branch}",
-    "tags_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/tags",
-    "blobs_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/git/blobs{/sha}",
-    "git_tags_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/git/tags{/sha}",
-    "git_refs_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/git/refs{/sha}",
-    "trees_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/git/trees{/sha}",
-    "statuses_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/statuses/{sha}",
-    "languages_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/languages",
-    "stargazers_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/stargazers",
-    "contributors_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/contributors",
-    "subscribers_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/subscribers",
-    "subscription_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/subscription",
-    "commits_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/commits{/sha}",
-    "git_commits_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/git/commits{/sha}",
-    "comments_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/comments{/number}",
-    "issue_comment_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues/comments{/number}",
-    "contents_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/contents/{+path}",
-    "compare_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/compare/{base}...{head}",
-    "merges_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/merges",
-    "archive_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/{archive_format}{/ref}",
-    "downloads_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/downloads",
-    "issues_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/issues{/number}",
-    "pulls_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/pulls{/number}",
-    "milestones_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/milestones{/number}",
-    "notifications_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/notifications{?since,all,participating}",
-    "labels_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/labels{/name}",
-    "releases_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/releases{/id}",
-    "deployments_url": "https://api.github.com/repos/openshift/tektoncd-pipeline/deployments",
-    "created_at": "2018-12-14T20:33:27Z",
-    "updated_at": "2021-04-01T08:35:31Z",
-    "pushed_at": "2021-04-02T00:41:39Z",
-    "git_url": "git://github.com/openshift/tektoncd-pipeline.git",
-    "ssh_url": "git@github.com:openshift/tektoncd-pipeline.git",
-    "clone_url": "https://github.com/openshift/tektoncd-pipeline.git",
-    "svn_url": "https://github.com/openshift/tektoncd-pipeline",
-    "homepage": "",
-    "size": 89796,
-    "stargazers_count": 10,
-    "watchers_count": 10,
-    "language": "Shell",
-    "has_issues": false,
+    "html_url": "https://github.com/chmouel/scratchmyback",
+    "description": "Back scratching",
+    "fork": false,
+    "url": "https://api.github.com/repos/chmouel/scratchmyback",
+    "forks_url": "https://api.github.com/repos/chmouel/scratchmyback/forks",
+    "keys_url": "https://api.github.com/repos/chmouel/scratchmyback/keys{/key_id}",
+    "collaborators_url": "https://api.github.com/repos/chmouel/scratchmyback/collaborators{/collaborator}",
+    "teams_url": "https://api.github.com/repos/chmouel/scratchmyback/teams",
+    "hooks_url": "https://api.github.com/repos/chmouel/scratchmyback/hooks",
+    "issue_events_url": "https://api.github.com/repos/chmouel/scratchmyback/issues/events{/number}",
+    "events_url": "https://api.github.com/repos/chmouel/scratchmyback/events",
+    "assignees_url": "https://api.github.com/repos/chmouel/scratchmyback/assignees{/user}",
+    "branches_url": "https://api.github.com/repos/chmouel/scratchmyback/branches{/branch}",
+    "tags_url": "https://api.github.com/repos/chmouel/scratchmyback/tags",
+    "blobs_url": "https://api.github.com/repos/chmouel/scratchmyback/git/blobs{/sha}",
+    "git_tags_url": "https://api.github.com/repos/chmouel/scratchmyback/git/tags{/sha}",
+    "git_refs_url": "https://api.github.com/repos/chmouel/scratchmyback/git/refs{/sha}",
+    "trees_url": "https://api.github.com/repos/chmouel/scratchmyback/git/trees{/sha}",
+    "statuses_url": "https://api.github.com/repos/chmouel/scratchmyback/statuses/{sha}",
+    "languages_url": "https://api.github.com/repos/chmouel/scratchmyback/languages",
+    "stargazers_url": "https://api.github.com/repos/chmouel/scratchmyback/stargazers",
+    "contributors_url": "https://api.github.com/repos/chmouel/scratchmyback/contributors",
+    "subscribers_url": "https://api.github.com/repos/chmouel/scratchmyback/subscribers",
+    "subscription_url": "https://api.github.com/repos/chmouel/scratchmyback/subscription",
+    "commits_url": "https://api.github.com/repos/chmouel/scratchmyback/commits{/sha}",
+    "git_commits_url": "https://api.github.com/repos/chmouel/scratchmyback/git/commits{/sha}",
+    "comments_url": "https://api.github.com/repos/chmouel/scratchmyback/comments{/number}",
+    "issue_comment_url": "https://api.github.com/repos/chmouel/scratchmyback/issues/comments{/number}",
+    "contents_url": "https://api.github.com/repos/chmouel/scratchmyback/contents/{+path}",
+    "compare_url": "https://api.github.com/repos/chmouel/scratchmyback/compare/{base}...{head}",
+    "merges_url": "https://api.github.com/repos/chmouel/scratchmyback/merges",
+    "archive_url": "https://api.github.com/repos/chmouel/scratchmyback/{archive_format}{/ref}",
+    "downloads_url": "https://api.github.com/repos/chmouel/scratchmyback/downloads",
+    "issues_url": "https://api.github.com/repos/chmouel/scratchmyback/issues{/number}",
+    "pulls_url": "https://api.github.com/repos/chmouel/scratchmyback/pulls{/number}",
+    "milestones_url": "https://api.github.com/repos/chmouel/scratchmyback/milestones{/number}",
+    "notifications_url": "https://api.github.com/repos/chmouel/scratchmyback/notifications{?since,all,participating}",
+    "labels_url": "https://api.github.com/repos/chmouel/scratchmyback/labels{/name}",
+    "releases_url": "https://api.github.com/repos/chmouel/scratchmyback/releases{/id}",
+    "deployments_url": "https://api.github.com/repos/chmouel/scratchmyback/deployments",
+    "created_at": "2021-04-18T10:57:45Z",
+    "updated_at": "2021-05-10T13:18:37Z",
+    "pushed_at": "2021-05-12T09:55:14Z",
+    "git_url": "git://github.com/chmouel/scratchmyback.git",
+    "ssh_url": "git@github.com:chmouel/scratchmyback.git",
+    "clone_url": "https://github.com/chmouel/scratchmyback.git",
+    "svn_url": "https://github.com/chmouel/scratchmyback",
+    "homepage": null,
+    "size": 22,
+    "stargazers_count": 0,
+    "watchers_count": 0,
+    "language": null,
+    "has_issues": true,
     "has_projects": true,
     "has_downloads": true,
-    "has_wiki": false,
+    "has_wiki": true,
     "has_pages": false,
-    "forks_count": 9,
+    "forks_count": 0,
     "mirror_url": null,
     "archived": false,
     "disabled": false,
-    "open_issues_count": 3,
+    "open_issues_count": 1,
     "license": {
-      "key": "apache-2.0",
-      "name": "Apache License 2.0",
-      "spdx_id": "Apache-2.0",
-      "url": "https://api.github.com/licenses/apache-2.0",
-      "node_id": "MDc6TGljZW5zZTI="
+      "key": "gpl-3.0",
+      "name": "GNU General Public License v3.0",
+      "spdx_id": "GPL-3.0",
+      "url": "https://api.github.com/licenses/gpl-3.0",
+      "node_id": "MDc6TGljZW5zZTk="
     },
-    "forks": 9,
-    "open_issues": 3,
-    "watchers": 10,
-    "default_branch": "master"
-  },
-  "organization": {
-    "login": "openshift",
-    "id": 792337,
-    "node_id": "MDEyOk9yZ2FuaXphdGlvbjc5MjMzNw==",
-    "url": "https://api.github.com/orgs/openshift",
-    "repos_url": "https://api.github.com/orgs/openshift/repos",
-    "events_url": "https://api.github.com/orgs/openshift/events",
-    "hooks_url": "https://api.github.com/orgs/openshift/hooks",
-    "issues_url": "https://api.github.com/orgs/openshift/issues",
-    "members_url": "https://api.github.com/orgs/openshift/members{/member}",
-    "public_members_url": "https://api.github.com/orgs/openshift/public_members{/member}",
-    "avatar_url": "https://avatars.githubusercontent.com/u/792337?v=4",
-    "description": "The developer and operations friendly Kubernetes distro"
+    "forks": 0,
+    "open_issues": 1,
+    "watchers": 0,
+    "default_branch": "main"
   },
   "sender": {
-    "login": "alanfx",
-    "id": 3027310,
-    "node_id": "MDQ6VXNlcjMwMjczMTA=",
-    "avatar_url": "https://avatars.githubusercontent.com/u/3027310?v=4",
+    "login": "chmouel",
+    "id": 98980,
+    "node_id": "MDQ6VXNlcjk4OTgw",
+    "avatar_url": "https://avatars.githubusercontent.com/u/98980?v=4",
     "gravatar_id": "",
-    "url": "https://api.github.com/users/alanfx",
-    "html_url": "https://github.com/alanfx",
-    "followers_url": "https://api.github.com/users/alanfx/followers",
-    "following_url": "https://api.github.com/users/alanfx/following{/other_user}",
-    "gists_url": "https://api.github.com/users/alanfx/gists{/gist_id}",
-    "starred_url": "https://api.github.com/users/alanfx/starred{/owner}{/repo}",
-    "subscriptions_url": "https://api.github.com/users/alanfx/subscriptions",
-    "organizations_url": "https://api.github.com/users/alanfx/orgs",
-    "repos_url": "https://api.github.com/users/alanfx/repos",
-    "events_url": "https://api.github.com/users/alanfx/events{/privacy}",
-    "received_events_url": "https://api.github.com/users/alanfx/received_events",
+    "url": "https://api.github.com/users/chmouel",
+    "html_url": "https://github.com/chmouel",
+    "followers_url": "https://api.github.com/users/chmouel/followers",
+    "following_url": "https://api.github.com/users/chmouel/following{/other_user}",
+    "gists_url": "https://api.github.com/users/chmouel/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/chmouel/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/chmouel/subscriptions",
+    "organizations_url": "https://api.github.com/users/chmouel/orgs",
+    "repos_url": "https://api.github.com/users/chmouel/repos",
+    "events_url": "https://api.github.com/users/chmouel/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/chmouel/received_events",
     "type": "User",
     "site_admin": false
   },
   "installation": {
-    "id": 12019834,
-    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTIwMTk4MzQ="
+    "id": 16556382,
+    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY1NTYzODI="
   }
 }