-
Notifications
You must be signed in to change notification settings - Fork 17
/
task-create-pr.yaml
44 lines (43 loc) · 1.1 KB
/
task-create-pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: task-create-pr
spec:
workspaces:
- name: source
params:
- name: title
type: string
description: PR Title
- name: body
type: string
default: ""
description: The body of the PR request
- name: github_secret
type: string
default: github
description: "The name of the secret that has your github username and token"
steps:
- name: run-commands
image: docker.io/michaelin/github-cli:latest
script: |
#!/usr/bin/env bash
# git create PR
gh pr create -t "$(params.title)" -b "$(params.body)"
workingDir: $(workspaces.source.path)
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: $(params.github_secret)
key: password
- name: GITHUB_USER
valueFrom:
secretKeyRef:
name: $(params.github_secret)
key: username
- name: GITHUB_EMAIL
valueFrom:
secretKeyRef:
name: $(params.github_secret)
key: email