1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-26 06:23:37 +00:00
catalog/task/github-add-comment/0.1
PuneetPunamiya 0edd917532 This patch splits github-add-comment task from the github directory
Changes include:
  - moves github-add-comment task to the task directory
  - moves and modifies readme from github to github-add-comment
  - rename the yaml filename to match the resource name

Issue: #386

Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
2020-07-13 13:41:58 +01:00
..
github-add-comment.yaml This patch splits github-add-comment task from the github directory 2020-07-13 13:41:58 +01:00
README.md This patch splits github-add-comment task from the github directory 2020-07-13 13:41:58 +01:00

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"

Add a comment to an issue or a pull request

The github-add-comment task let you add a comment to a pull request or an issue.

Install the Task

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/github-add-comment/0.1/github-add-comment.yaml

Parameters

  • 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
  • REQUEST_URL:: The GitHub pull request or issue url, e.g: https://github.com/tektoncd/catalog/issues/46
  • COMMENT:: The actual comment to add e.g: don't forget to eat your vegetables before commiting..

Usage

This TaskRun add a comment to an issue.

---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  labels:
    tekton.dev/task: github-add-comment
  name: github-add-comment-to-pr-22
spec:
  taskRef:
    kind: Task
    name: github-add-comment
  params:
    - name: REQUEST_URL
      value: https://github.com/chmouel/scratchpad/pull/46
    - name: COMMENT
      value: |
          The cat went here and there
          And the moon spun round like a top,
          And the nearest kin of the moon,
          The creeping cat, looked up.
          Black Minnaloushe stared at the moon,
          For, wander and wail as he would,
          The pure cold light in the sky
          Troubled his animal blood.