1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-22 06:02:51 +00:00
catalog/task/github-close-issue/0.1
PuneetPunamiya 5a3e5f630f Adds category field as an annotation as tekton.dev/categories
- Initially all tags were mapped to categories in Hub,
     for e.g. config.yaml: https://github.com/tektoncd/hub/blob/master/config.yaml,
     so whenever a new tag was added in a task it was mapped to a category called `others`.
     Hence before every release we had to manually map these new tags to some category,
     hence after the discussion in Catalog and Hub WG, a proposal was created for adding
     a category as an annotation.

   - PR to update the TEP-0003-Tekton Catalog Organization: https://github.com/tektoncd/community/pull/352

Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
2021-07-26 13:15:08 +01:00
..
github-close-issue.yaml Adds category field as an annotation as tekton.dev/categories 2021-07-26 13:15:08 +01:00
README.md Update self reference from master to main 🧙 2021-03-19 11:09:49 +00: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://raw.githubusercontent.com/tektoncd/catalog/main/task/github-close-issue/0.1/github-close-issue.yaml

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)

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