mirror of
https://github.com/tektoncd/catalog.git
synced 2024-11-22 06:02:51 +00:00
ccd1080419
Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com> |
||
---|---|---|
.. | ||
samples | ||
github-add-labels.yaml | ||
README.md |
Add labels to an issue or a pull request
This task
can be used to add labels to a github pull request
or an issue
.
Install the Task
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/github-add-labels/0.1/github-add-labels.yaml
Parameters
- GITHUB_HOST_URL: The GitHub host, adjust this if you run a GitHub enteprise (default:
api.github.com
). - API_PATH_PREFIX: The API path prefix, GitHub Enterprise has a prefix (e.g.:
api/v3
default:""
). - REQUEST_URL: The GitHub issue or pull request URL where we want to add labels (e.g.
https://github.com/foo/bar/pull/10
). - LABELS: The actual labels to add. Multiple labels can be added in the form of
array
. - GITHUB_TOKEN_SECRET: The name of the
secret
holding the github-token (default:github
). - GITHUB_TOKEN_SECRET_KEY: The name of the
secret key
holding the github-token (default:token
).
Secret
Secret
to provide Githubaccess token
to authenticate to the Github.
Check this to get personal access token for Github
.
Usage
This task expects a secret named github to exists, with a GitHub token in token
with enough privileges to add label to a pull request or an issue.
To add labels to a pull request or an issue, put all the required params, add required secrets and labels will be added to respective pull request or an issue.
Secrets
can be created as follows:
apiVersion: v1
kind: Secret
metadata:
name: github
type: Opaque
stringData:
token: $(personal_github_token)
or
kubectl create secret generic github --from-literal token="MY_TOKEN"
Multiple labels
can be added in Taskrun as follows:
params:
- name: REQUEST_URL
value: https://github.com/Divyansh42/aws-cli/pull/1
- name: LABELS
value:
- approve
- kind/feature
This can be referred to create a Taskrun.