mirror of
https://github.com/tektoncd/catalog.git
synced 2024-11-22 06:02:51 +00:00
57ebef41f9
Changes include: - moves the build-push-gke-deploy task to the task directory - moves and modifies readme file from gke-deploy to build-push-gke-deploy - moves examples directory from gke-deploy Issue : #386 Signed-off-by: Shiv Verma <shverma@redhat.com> |
||
---|---|---|
.. | ||
github-set-status.yaml | ||
README.md |
GitHub
A collection of tasks to help working with the GitHub API.
GitHub token
Most tasks would expect to have a secret set in the kubernetes secret github
with a GitHub token in the key token
, you can easily create it on the
command line with kubectl
like this :
kubectl create secret generic github --from-literal token="MY_TOKEN"
Set Status on a Commit/PR
The github-set-status
task allows external services to mark GtiHUB commits
with an error
, failure
, pending
, or success
state, which is then
reflected in pull requests involving those commits.
Statuses include as well a description
and a target_url
, to give the user
informations about the CI statuses or a direct link to the full log.
Install the Task
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/github-set-status/0.1/github-set-status.yaml
Parameters
- REPO_FULL_NAME:: The GitHub repository full name, e.g:
tektoncd/catalog
- GITHUB_HOST_URL:: The GitHub host domain default:
api.github.com
- API_PATH_PREFIX:: The GitHub Enterprise has a prefix for the API path. e.g:
/api/v3
- SHA:: The commit SHA to set the status for e.g:
tektoncd/catalog
- TARGET_URL:: The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example you can link to a dashboard URL so users can follow a Pipeline/Task run.
- DESCRIPTION:: A short description of the status. e.g:
Building your PR
- CONTEXT: The GitHub context, A string label to differentiate this status
from the status of other systems. e.g:
continuous-integration/tekton
- STATE: The state of the status. Can be one of the following
error
,failure
,pending
, orsuccess
.
Usage
This TaskRun sets a commit on GitHub to pending
getting tested by the CI.
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
labels:
tekton.dev/task: github-set-status
name: github-set-status-run-on-commit-bd93
spec:
taskRef:
kind: Task
name: github-set-status
params:
- name: REPO_FULL_NAME
value: tektoncd/catalog
- name: SHA
value: bd93869b489258cef567ccf85e7ef6bc0d6949ea
- name: DESCRIPTION
value: "Build has started"
- name: STATE
value: pending
- name: TARGET_URL
value: https://tekon/dashboard/taskrun/log