1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00
catalog/task/github-close-issue/0.1
Quan Zhang e294e1246b [TEP-0110] Update Tekton Catalog installation instructions
Prior to this change, the installation instructions directly use the resource urls in the Catalog repo, which results in tight coupling between the organization and how users fetch resources (as described in TEP-0110). This commit updates the installation guide to install Tekton Catalog resources via Tekton Hub Api: https://github.com/tektoncd/hub/pull/539

This change decouples the Tekton Catalog organization from resouces resolution, which enables Tekton Catalog reorganization.
2022-08-16 16:25:52 +01:00
..
github-close-issue.yaml Add linux/amd64 platform annotation to the rest of the tasks 2021-10-29 17:08:38 +01:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

Close an issue or a pull request

The github-close-issue task let you close a pull request or an issue.

Install the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/github-close-issue/0.1/raw

Secrets

This 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"

Check this to get personal access token for Github.

See GitHub's documentation on Understanding scopes for OAuth Apps to figure out what scopes you need to give to this token to add comment to an issue or a pull request.

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)

Platforms

The Task can be run on linux/amd64 platform.

Usage

This TaskRun close an issue on a task.

---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  labels:
    tekton.dev/task: github-close-issue
  name: github-close-issue-to-pr-46
spec:
  taskRef:
    kind: Task
    name: github-close-issue
  params:
    - name: REQUEST_URL
      value: https://github.com/chmouel/scratchpad/pull/46