Tekton Interceptor to get
.tekton.yaml
from GitHub
github-pipeline-config
loads pipeline-config
from GitHub, then tries to read existing one
from InterceptorRequest#extensions["pipeline-config"]
, merges them together, and returns merged result
as InterceptorResponse#extensions["pipeline-config"]
.
github-pipeline-config
can be configured by using environment variables, a configuration file, or flags.
Environment Variable | Description | Required | Default |
---|---|---|---|
ADDR |
The address and port. | No | "0.0.0.0:80" |
GITHUB_APP_ID |
GitHub App ID. Can be found at https://github.com/settings/apps under Edit > General > About > App ID |
Yes | "" |
GITHUB_INSTALLATION_ID |
GitHub Installation ID. | Yes | "" |
GITHUB_APP_KEY |
GitHub App Private Key. | Yes | "" |
Field Name | Description | Required | Default |
---|---|---|---|
addr |
The address and port. | No | "0.0.0.0:80" |
github-app-id |
GitHub App ID. Can be found at https://github.com/settings/apps under Edit > General > About > App ID |
Yes | "" |
github-installation-id |
GitHub Installation ID. | Yes | "" |
github-app-key |
GitHub App Private Key. | Yes | "" |
Sample configuration file:
github-app-id: "12345"
github-installation-id: "6789"
github-app-key: "/etc/config/github/privateKey.pem"
By default, github-pipeline-config
lookups a configuration file in the following order:
$HOME/.config/github-pipeline-config/config.yaml
/etc/config/github-pipeline-config/config.yaml
$PWD/config/github-pipeline-config/config.yaml
Also, github-pipeline-config
allows to set a path to a configuration file by using a --config
flag:
github-pipeline-config --config=$PWD/github-pipeline-config.yaml
Flag Name | Description | Required | Default |
---|---|---|---|
config |
The path to the config file. | No | "" |
github-app-id |
GitHub App ID. Can be found at https://github.com/settings/apps under Edit > General > About > App ID |
Yes | "" |
github-installation-id |
GitHub Installation ID. | Yes | "" |
github-app-key |
GitHub App Private Key. | Yes | "" |
github-pipeline-config
allows to specify namespace
and name
parameters to read Kubernetes ConfigMap.
Parameter Name | Description |
---|---|
owner |
GitHub org or user who owns the repo (for ElementalCognition/tekton-toolbox , this should be ElementalCognition ). |
repo |
GitHub repo name (for ElementalCognition/tekton-toolbox , this should be tekton-toolbox ). |
ref |
GitHub Git Ref. |
Sample Trigger
file:
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: Trigger
metadata:
name: my-trigger
spec:
interceptors:
- params:
- name: owner
value: body.repository.owner.login
- name: repo
value: body.repository.name
- name: ref
value: >-
"pull_request" in body
? body.pull_request.head.sha
: body.head_commit.id
ref:
kind: ClusterInterceptor
name: github-pipeline-config