Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Latest commit

 

History

History
91 lines (77 loc) · 2.75 KB

README.md

File metadata and controls

91 lines (77 loc) · 2.75 KB

pullrequest-init

pullrequest-init fetches pull request data from the given URL and places it in the provided path.

This binary outputs a generic pull request object into pr.json, as well as provider specific payloads.

Currently supported providers:

  • GitHub

Generic pull request payload

The payload generated by default aims to abstract the base features of any pull request provider. Since there is no one true spec for pull requests, not every feature may be available. The payload is output to $PATH/pr.json and looks like:

{
    "Type": "github",
    "ID": 188184279,
    "Head": {
        "Repo": "https://github.com/wlynch/test.git",
        "Branch": "dev",
        "SHA": "9bcde245572c74329827acdcab88792ebb84d578"
    },
    "Base": {
        "Repo": "https://github.com/wlynch/test.git",
        "Branch": "master",
        "SHA": "1e80c83ed01e187669b836096335d1c8a2c57182"
    },
    "Comments": [
        {
            "Text": "test comment",
            "Author": "wlynch",
            "ID": 494418247,
            "Raw": "/tmp/prtest/github/comments/494418247.json"
        }
    ],
    "Labels": [
        {
            "Text": "my-label"
        }
    ],
    "Statuses": [
        {
            "Code": "success",
            "Description": "Job succeeded.",
            "ID": "pull-tekton-pipeline-go-coverage",
            "URL": "https://tekton-releases.appspot.com/build/tekton-prow/pr-logs/pull/tektoncd_pipeline/895/pull-tekton-pipeline-go-coverage/1141483806818045953/"
        },
    ],
    "Raw": "/tmp/prtest/github/pr.json",
    "RawStatus": "/tmp/pr/github/status.json"
}

GitHub

GitHub pull requests will output these additional files:

For now, these files are read-only.

The binary will look for GitHub credentials in the ${GITHUBTOKEN} environment variable. This should generally be specified as a secret with the field name githubToken in the PullRequestResource definition.

Status code conversion

Tekton Status Code GitHub Status State
success success
neutral success
queued pending
in_progress pending
failure failure
unknown error
error error
timeout error
canceled error
action_required error