Repository: openshift-pipelines/pipelines-as-code (go)

Issue:
rerequest from Github checks interface is not working on push
triggers spits this out : 

```
{"level":"error","ts":"2021-06-02T15:48:55.186Z","logger":"eventlistener","caller":"sink/sink.go:232","msg":"failed to ApplyEventValuesToParams: failed to replace JSONPath value for param pull_request_number: $(body.check_run.check_suite.pull_requests[0].number): array index out of bounds: index 0, length 0","knative.dev/controller":"eventlistener","/triggers-eventid":"a2f50cba-a52a-4c9e-9a91-a4d99b961317","/trigger":"github-check-run-recheck","stacktrace":"github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger\n\t/opt/app-root/src/go/src/github.com/tektoncd/triggers/pkg/sink/sink.go:232\ngithub.com/tektoncd/triggers/pkg/sink.Sink.HandleEvent.func1\n\t/opt/app-root/src/go/src/github.com/tektoncd/triggers/pkg/sink/sink.go:127"}
```

Pull request:
Handle ui rerequest on push
We were only handling it on pull_request, we had to do a whole different
thing to make it  work on push.

We set the sender to the one who clicks on the rerequest on push,
compared on pull_request which we assume the sender is pr author.

The only way to be able to do a rerequest on push is to be a owner of
the repository, so that should be harmless.

Closes #111 

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>

Patch:
diff --git a/config/401-trigger-issue-recheck.yaml b/config/401-trigger-issue-recheck.yaml
index 7df1d356..2dc3cba7 100644
--- a/config/401-trigger-issue-recheck.yaml
+++ b/config/401-trigger-issue-recheck.yaml
@@ -11,6 +11,10 @@ spec:
   params:
     - name: action
       value: $(body.action)
+    - name: head_branch
+      value: $(body.check_run.check_suite.head_branch)
+    - name: head_sha
+      value: $(body.check_run.check_suite.head_sha)
     - name: trigger_target
       value: "issue-recheck"
     - name: event_type
@@ -19,8 +23,14 @@ spec:
       value: $(body.repository.owner.login)
     - name: repository
       value: $(body.repository.name)
+    - name: url
+      value: $(body.repository.html_url)
+    - name: default_branch
+      value: $(body.repository.default_branch)
     - name: pull_request_number
-      value: $(body.check_run.check_suite.pull_requests[0].number)
+      value: $(body.check_run.check_suite.pull_requests[?(@.number)].number)
+    - name: sender
+      value: $(body.sender.login)
     - name: installation_id
       value: $(body.installation.id)
 
@@ -36,10 +46,15 @@ metadata:
 spec:
   params:
     - name: action
+    - name: head_branch
+    - name: head_sha
     - name: event_type
     - name: owner
     - name: repository
+    - name: default_branch
+    - name: url
     - name: pull_request_number
+    - name: sender
     - name: installation_id
     - name: trigger_target
   resourcetemplates:
@@ -57,12 +72,22 @@ spec:
             value: $(tt.params.action)
           - name: event_type
             value: $(tt.params.event_type)
+          - name: head_branch
+            value: $(tt.params.head_branch)
+          - name: head_sha
+            value: $(tt.params.head_sha)
           - name: owner
             value: $(tt.params.owner)
           - name: repository
             value: $(tt.params.repository)
+          - name: default_branch
+            value: $(tt.params.default_branch)
+          - name: url
+            value: $(tt.params.url)
           - name: pull_request_number
             value: $(tt.params.pull_request_number)
+          - name: sender
+            value: $(tt.params.sender)
           - name: installation_id
             value: $(tt.params.installation_id)
           - name: trigger_target
@@ -71,10 +96,15 @@ spec:
           params:
             - name: trigger_target
             - name: action
+            - name: head_branch
+            - name: head_sha
             - name: event_type
             - name: owner
             - name: repository
+            - name: default_branch
+            - name: url
             - name: pull_request_number
+            - name: sender
             - name: installation_id
           workspaces:
             - name: secrets
@@ -94,14 +124,25 @@ spec:
                 params:
                   - name: action
                     type: string
+                  - name: head_branch
+                    type: string
+                  - name: head_sha
+                    type: string
                   - name: event_type
                     type: string
                   - name: owner
                     type: string
                   - name: repository
                     type: string
+                  - name: default_branch
+                    type: string
+                  - name: url
+                    type: string
                   - name: pull_request_number
                     type: string
+                    default: "000"
+                  - name: sender
+                    type: string
                   - name: token
                     type: string
                   - name: trigger_target
@@ -111,42 +152,60 @@ spec:
                     imagePullPolicy: Always
                     image: "ko://github.com/openshift-pipelines/pipelines-as-code/cmd/pipelines-as-code"
                     script: |
+                      #!/usr/bin/env bash
+                      set -eux
+                      prnumber=$(params.pull_request_number)
+                      [[ ${prnumber} != "[]" ]] && prnumber="[{\"number\": ${prnumber}}]"
                       cat << EOF > /tmp/payload.json
                       {
                         "action": "$(params.action)",
                         "check_run": {
                           "check_suite": {
-                            "pull_requests": [
-                              {
-                                "number": $(params.pull_request_number)
-                              }
-                            ]
+                            "head_branch": "$(params.head_branch)",
+                            "head_sha": "$(params.head_sha)",
+                            "pull_requests": ${prnumber}
                           }
                         },
                         "repository": {
+                          "default_branch": "$(params.default_branch)",
+                          "html_url": "$(params.url)",
                           "name": "$(params.repository)",
                           "owner": {
                             "login": "$(params.owner)"
                           }
+                        },
+                        "sender": {
+                          "login": "$(params.sender)"
                         }
                       }
                       EOF
+                      cat /tmp/payload.json
                       pipelines-as-code --trigger-target=$(params.trigger_target) \
                         --payload-file=/tmp/payload.json --token="$(params.token)" --webhook-type="$(params.event_type)"
 
               params:
                 - name: action
                   value: "$(params.action)"
+                - name: head_branch
+                  value: "$(params.head_branch)"
+                - name: head_sha
+                  value: "$(params.head_sha)"
                 - name: trigger_target
                   value: "$(params.trigger_target)"
                 - name: event_type
                   value: "$(params.event_type)"
                 - name: owner
                   value: "$(params.owner)"
+                - name: url
+                  value: "$(params.url)"
                 - name: repository
                   value: "$(params.repository)"
+                - name: default_branch
+                  value: "$(params.default_branch)"
                 - name: pull_request_number
                   value: "$(params.pull_request_number)"
+                - name: sender
+                  value: "$(params.sender)"
                 - name: token
                   value: "$(tasks.get-token.results.token)"
         workspaces:
diff --git a/hack/replay-gh-events.py b/hack/replay-gh-events.py
index c2367100..5be4d26e 100755
--- a/hack/replay-gh-events.py
+++ b/hack/replay-gh-events.py
@@ -22,6 +22,7 @@ import hashlib
 import hmac
 import json
 import subprocess
+import os
 
 import requests
 
@@ -53,7 +54,7 @@ def get_installation_id_and_webhook_secret():
 
 def main(args):
     application_id, secret = get_installation_id_and_webhook_secret()
-    el = get_el_route()
+    el = args.eroute and args.eroute or get_el_route()
     text = open(args.json_file).read()
     jeez = json.loads(text)
     esha256 = hmac.new(secret.encode("utf-8"),
@@ -94,6 +95,10 @@ def main(args):
 
 def parse_args():
     parser = argparse.ArgumentParser(description='Replay a webhook')
+    parser.add_argument("--eventlistenner-route",
+                        dest="eroute",
+                        help="Route hostname (default to detect on openshift)",
+                        default=os.environ.get("EL_ROUTE"))
     parser.add_argument("json_file", help="json file name")
     return parser.parse_args()
 
diff --git a/pkg/webvcs/github.go b/pkg/webvcs/github.go
index 61b31958..3551280c 100644
--- a/pkg/webvcs/github.go
+++ b/pkg/webvcs/github.go
@@ -85,8 +85,21 @@ func payloadFix(payload string) string {
 
 func (v GithubVCS) handleReRequestEvent(ctx context.Context, log *zap.SugaredLogger, event *github.CheckRunEvent) (RunInfo, error) {
 	runinfo := RunInfo{
-		Owner:      event.GetRepo().GetOwner().GetLogin(),
-		Repository: event.GetRepo().GetName(),
+		Owner:         event.GetRepo().GetOwner().GetLogin(),
+		Repository:    event.GetRepo().GetName(),
+		URL:           event.GetRepo().GetHTMLURL(),
+		DefaultBranch: event.GetRepo().GetDefaultBranch(),
+		SHA:           event.GetCheckRun().GetCheckSuite().GetHeadSHA(),
+		HeadBranch:    event.GetCheckRun().GetCheckSuite().GetHeadBranch(),
+	}
+	// If we don't have a pull_request in this it probably mean a push
+	if len(event.GetCheckRun().GetCheckSuite().PullRequests) == 0 {
+		runinfo.BaseBranch = runinfo.HeadBranch
+		runinfo.EventType = "push"
+		// we allow the rerequest user here, not the push user, i guess it's
+		// fine because you can't do a rereq without being a github owner?
+		runinfo.Sender = event.GetSender().GetLogin()
+		return runinfo, nil
 	}
 	prNumber := event.GetCheckRun().GetCheckSuite().PullRequests[0].GetNumber()
 	log.Infof("Recheck of PR %s/%s#%d has been requested", runinfo.Owner, runinfo.Repository, prNumber)


Test patch:
diff --git a/pkg/webvcs/github_test.go b/pkg/webvcs/github_test.go
index 74f0c819..064a7fc2 100644
--- a/pkg/webvcs/github_test.go
+++ b/pkg/webvcs/github_test.go
@@ -130,7 +130,7 @@ func TestPayLoadFix(t *testing.T) {
 	assert.NilError(t, err)
 }
 
-func TestParsePayloadRerequest(t *testing.T) {
+func TestParsePayloadRerequestFromPullRequest(t *testing.T) {
 	checkrunSender := "jean-pierre"
 	prOwner := "openshift"
 	repoName := "pipelines"
@@ -161,6 +161,49 @@ func TestParsePayloadRerequest(t *testing.T) {
 	assert.Assert(t, strings.Contains(observer.TakeAll()[0].Message, "Recheck of PR"))
 }
 
+func TestParsePayloadRerequestFromPush(t *testing.T) {
+	sender := "jean-pierre"
+	headBranch := "tartonpion"
+	headSHA := "abcd"
+	owner := "owner"
+	repository := "repository"
+	url := fmt.Sprintf("https://github.com/%s/%s", owner, repository)
+	checkrunEvent := fmt.Sprintf(`{
+  "action": "rerequested",
+  "check_run": {
+    "check_suite": {
+      "head_branch": "%s",
+      "head_sha": "%s",
+      "pull_requests": []
+    }
+  },
+  "repository": {
+    "default_branch": "main",
+    "html_url": "%s",
+    "name": "%s",
+    "owner": {
+      "login": "%s"
+    }
+  },
+  "sender": {
+    "login": "%s"
+  }
+}`,
+		headBranch, headSHA, url, repository, owner, sender)
+	ctx, _ := rtesting.SetupFakeContext(t)
+	gvcs := GithubVCS{}
+	logger, _ := getLogger()
+	runinfo, err := gvcs.ParsePayload(ctx, logger, "check_run", "issue-recheck", checkrunEvent)
+	assert.NilError(t, err)
+
+	assert.Equal(t, runinfo.EventType, "push")
+	assert.Equal(t, runinfo.HeadBranch, headBranch)
+	assert.Equal(t, runinfo.Owner, owner)
+	assert.Equal(t, runinfo.Repository, repository)
+	assert.Equal(t, runinfo.URL, url)
+	assert.Assert(t, sender == runinfo.Sender) // TODO: should it be set to the push sender?
+}
+
 func TestParsePayLoadRetest(t *testing.T) {
 	issueSender := "tartanpion"
 	prOwner := "user1"
diff --git a/test/fixtures/check_suite_rerequest_push.json b/test/fixtures/check_suite_rerequest_push.json
new file mode 100644
index 00000000..01ea711c
--- /dev/null
+++ b/test/fixtures/check_suite_rerequest_push.json
@@ -0,0 +1,279 @@
+{
+  "action": "rerequested",
+  "check_run": {
+    "id": 2729282468,
+    "node_id": "MDg6Q2hlY2tSdW4yNzI5MjgyNDY4",
+    "head_sha": "510a0faaa7cc35c5bab224655b435eaac76ec5a7",
+    "external_id": "",
+    "url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/check-runs/2729282468",
+    "html_url": "https://github.com/openshift-pipelines/pipelines-as-code/runs/2729282468",
+    "details_url": "https://console-openshift-console.apps.paac.devcluster.openshift.com",
+    "status": "completed",
+    "conclusion": "failure",
+    "started_at": "2021-06-02T15:28:54Z",
+    "completed_at": "2021-06-02T15:28:56Z",
+    "output": {
+      "title": "😞 CI Run: Failed",
+      "summary": "Tekon CI has <b>failed</b>.",
+      "text": "There was an issue validating the commit: \"cannot match any pipeline on EventType: push, TargetBranch: refs/heads/main\"",
+      "annotations_count": 0,
+      "annotations_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/check-runs/2729282468/annotations"
+    },
+    "name": "Tekton Pipeline as Code CI",
+    "check_suite": {
+      "id": 2893348708,
+      "node_id": "MDEwOkNoZWNrU3VpdGUyODkzMzQ4NzA4",
+      "head_branch": "main",
+      "head_sha": "510a0faaa7cc35c5bab224655b435eaac76ec5a7",
+      "status": "queued",
+      "conclusion": null,
+      "url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/check-suites/2893348708",
+      "before": "ef75c7db8a921a8c0adaabe2e309f2f9d7ce5bd4",
+      "after": "510a0faaa7cc35c5bab224655b435eaac76ec5a7",
+      "pull_requests": [
+
+      ],
+      "app": {
+        "id": 112592,
+        "slug": "pipelines-as-code",
+        "node_id": "MDM6QXBwMTEyNTky",
+        "owner": {
+          "login": "openshift-pipelines",
+          "id": 57996262,
+          "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3OTk2MjYy",
+          "avatar_url": "https://avatars.githubusercontent.com/u/57996262?v=4",
+          "gravatar_id": "",
+          "url": "https://api.github.com/users/openshift-pipelines",
+          "html_url": "https://github.com/openshift-pipelines",
+          "followers_url": "https://api.github.com/users/openshift-pipelines/followers",
+          "following_url": "https://api.github.com/users/openshift-pipelines/following{/other_user}",
+          "gists_url": "https://api.github.com/users/openshift-pipelines/gists{/gist_id}",
+          "starred_url": "https://api.github.com/users/openshift-pipelines/starred{/owner}{/repo}",
+          "subscriptions_url": "https://api.github.com/users/openshift-pipelines/subscriptions",
+          "organizations_url": "https://api.github.com/users/openshift-pipelines/orgs",
+          "repos_url": "https://api.github.com/users/openshift-pipelines/repos",
+          "events_url": "https://api.github.com/users/openshift-pipelines/events{/privacy}",
+          "received_events_url": "https://api.github.com/users/openshift-pipelines/received_events",
+          "type": "Organization",
+          "site_admin": false
+        },
+        "name": "Pipelines as Code",
+        "description": "Pipelines as code application to validate your repositories with OpenShift Pipelines",
+        "external_url": "https://github.com/openshift-pipelines/pipelines-as-code/",
+        "html_url": "https://github.com/apps/pipelines-as-code",
+        "created_at": "2021-04-27T12:15:44Z",
+        "updated_at": "2021-04-27T12:25:57Z",
+        "permissions": {
+          "administration": "read",
+          "checks": "write",
+          "contents": "write",
+          "issues": "write",
+          "members": "read",
+          "metadata": "read",
+          "organization_plan": "read",
+          "pull_requests": "write"
+        },
+        "events": [
+          "commit_comment",
+          "issue_comment",
+          "pull_request",
+          "pull_request_review",
+          "pull_request_review_comment",
+          "push"
+        ]
+      },
+      "created_at": "2021-06-02T15:28:40Z",
+      "updated_at": "2021-06-02T20:00:50Z"
+    },
+    "app": {
+      "id": 112592,
+      "slug": "pipelines-as-code",
+      "node_id": "MDM6QXBwMTEyNTky",
+      "owner": {
+        "login": "openshift-pipelines",
+        "id": 57996262,
+        "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3OTk2MjYy",
+        "avatar_url": "https://avatars.githubusercontent.com/u/57996262?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/openshift-pipelines",
+        "html_url": "https://github.com/openshift-pipelines",
+        "followers_url": "https://api.github.com/users/openshift-pipelines/followers",
+        "following_url": "https://api.github.com/users/openshift-pipelines/following{/other_user}",
+        "gists_url": "https://api.github.com/users/openshift-pipelines/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/openshift-pipelines/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/openshift-pipelines/subscriptions",
+        "organizations_url": "https://api.github.com/users/openshift-pipelines/orgs",
+        "repos_url": "https://api.github.com/users/openshift-pipelines/repos",
+        "events_url": "https://api.github.com/users/openshift-pipelines/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/openshift-pipelines/received_events",
+        "type": "Organization",
+        "site_admin": false
+      },
+      "name": "Pipelines as Code",
+      "description": "Pipelines as code application to validate your repositories with OpenShift Pipelines",
+      "external_url": "https://github.com/openshift-pipelines/pipelines-as-code/",
+      "html_url": "https://github.com/apps/pipelines-as-code",
+      "created_at": "2021-04-27T12:15:44Z",
+      "updated_at": "2021-04-27T12:25:57Z",
+      "permissions": {
+        "administration": "read",
+        "checks": "write",
+        "contents": "write",
+        "issues": "write",
+        "members": "read",
+        "metadata": "read",
+        "organization_plan": "read",
+        "pull_requests": "write"
+      },
+      "events": [
+        "commit_comment",
+        "issue_comment",
+        "pull_request",
+        "pull_request_review",
+        "pull_request_review_comment",
+        "push"
+      ]
+    },
+    "pull_requests": [
+
+    ]
+  },
+  "repository": {
+    "id": 355197825,
+    "node_id": "MDEwOlJlcG9zaXRvcnkzNTUxOTc4MjU=",
+    "name": "pipelines-as-code",
+    "full_name": "openshift-pipelines/pipelines-as-code",
+    "private": false,
+    "owner": {
+      "login": "openshift-pipelines",
+      "id": 57996262,
+      "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3OTk2MjYy",
+      "avatar_url": "https://avatars.githubusercontent.com/u/57996262?v=4",
+      "gravatar_id": "",
+      "url": "https://api.github.com/users/openshift-pipelines",
+      "html_url": "https://github.com/openshift-pipelines",
+      "followers_url": "https://api.github.com/users/openshift-pipelines/followers",
+      "following_url": "https://api.github.com/users/openshift-pipelines/following{/other_user}",
+      "gists_url": "https://api.github.com/users/openshift-pipelines/gists{/gist_id}",
+      "starred_url": "https://api.github.com/users/openshift-pipelines/starred{/owner}{/repo}",
+      "subscriptions_url": "https://api.github.com/users/openshift-pipelines/subscriptions",
+      "organizations_url": "https://api.github.com/users/openshift-pipelines/orgs",
+      "repos_url": "https://api.github.com/users/openshift-pipelines/repos",
+      "events_url": "https://api.github.com/users/openshift-pipelines/events{/privacy}",
+      "received_events_url": "https://api.github.com/users/openshift-pipelines/received_events",
+      "type": "Organization",
+      "site_admin": false
+    },
+    "html_url": "https://github.com/openshift-pipelines/pipelines-as-code",
+    "description": "Pipelines as Code",
+    "fork": false,
+    "url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code",
+    "forks_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/forks",
+    "keys_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/keys{/key_id}",
+    "collaborators_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/collaborators{/collaborator}",
+    "teams_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/teams",
+    "hooks_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/hooks",
+    "issue_events_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/issues/events{/number}",
+    "events_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/events",
+    "assignees_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/assignees{/user}",
+    "branches_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/branches{/branch}",
+    "tags_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/tags",
+    "blobs_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/git/blobs{/sha}",
+    "git_tags_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/git/tags{/sha}",
+    "git_refs_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/git/refs{/sha}",
+    "trees_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/git/trees{/sha}",
+    "statuses_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/statuses/{sha}",
+    "languages_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/languages",
+    "stargazers_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/stargazers",
+    "contributors_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/contributors",
+    "subscribers_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/subscribers",
+    "subscription_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/subscription",
+    "commits_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/commits{/sha}",
+    "git_commits_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/git/commits{/sha}",
+    "comments_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/comments{/number}",
+    "issue_comment_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/issues/comments{/number}",
+    "contents_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/contents/{+path}",
+    "compare_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/compare/{base}...{head}",
+    "merges_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/merges",
+    "archive_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/{archive_format}{/ref}",
+    "downloads_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/downloads",
+    "issues_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/issues{/number}",
+    "pulls_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/pulls{/number}",
+    "milestones_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/milestones{/number}",
+    "notifications_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/notifications{?since,all,participating}",
+    "labels_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/labels{/name}",
+    "releases_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/releases{/id}",
+    "deployments_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/deployments",
+    "created_at": "2021-04-06T13:26:01Z",
+    "updated_at": "2021-06-02T17:44:56Z",
+    "pushed_at": "2021-06-02T17:44:53Z",
+    "git_url": "git://github.com/openshift-pipelines/pipelines-as-code.git",
+    "ssh_url": "git@github.com:openshift-pipelines/pipelines-as-code.git",
+    "clone_url": "https://github.com/openshift-pipelines/pipelines-as-code.git",
+    "svn_url": "https://github.com/openshift-pipelines/pipelines-as-code",
+    "homepage": null,
+    "size": 9038,
+    "stargazers_count": 3,
+    "watchers_count": 3,
+    "language": "Go",
+    "has_issues": true,
+    "has_projects": false,
+    "has_downloads": true,
+    "has_wiki": false,
+    "has_pages": false,
+    "forks_count": 4,
+    "mirror_url": null,
+    "archived": false,
+    "disabled": false,
+    "open_issues_count": 9,
+    "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="
+    },
+    "forks": 4,
+    "open_issues": 9,
+    "watchers": 3,
+    "default_branch": "main"
+  },
+  "organization": {
+    "login": "openshift-pipelines",
+    "id": 57996262,
+    "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3OTk2MjYy",
+    "url": "https://api.github.com/orgs/openshift-pipelines",
+    "repos_url": "https://api.github.com/orgs/openshift-pipelines/repos",
+    "events_url": "https://api.github.com/orgs/openshift-pipelines/events",
+    "hooks_url": "https://api.github.com/orgs/openshift-pipelines/hooks",
+    "issues_url": "https://api.github.com/orgs/openshift-pipelines/issues",
+    "members_url": "https://api.github.com/orgs/openshift-pipelines/members{/member}",
+    "public_members_url": "https://api.github.com/orgs/openshift-pipelines/public_members{/member}",
+    "avatar_url": "https://avatars.githubusercontent.com/u/57996262?v=4",
+    "description": ""
+  },
+  "sender": {
+    "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/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": 16557439,
+    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY1NTc0Mzk="
+  }
+}