Skip to content

Commit a14d364

Browse files
committed
ci: Make the GH set-status task reusable across repos
Signed-off-by: Ferenc Géczi <[email protected]>
1 parent b61a35e commit a14d364

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.tekton/github-pr-pipeline.yaml.part

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ spec:
2020
value: $(params.git-commit-sha)
2121
- name: STATE
2222
value: pending
23+
- name: REPO
24+
value: instana/python-sensor
2325
- name: github-set-check-status-to-success-or-failure
2426
runAfter:
2527
- github-set-check-status-to-pending
@@ -35,3 +37,5 @@ spec:
3537
value: $(params.git-commit-sha)
3638
- name: STATE
3739
value: success
40+
- name: REPO
41+
value: instana/python-sensor

.tekton/github-set-status-task.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ spec:
77
params:
88
- name: SHA
99
- name: STATE
10+
- name: REPO
1011
volumes:
1112
- name: githubtoken
1213
secret:
@@ -20,6 +21,8 @@ spec:
2021
value: $(params.SHA)
2122
- name: STATE
2223
value: $(params.STATE)
24+
- name: REPO
25+
value: $(params.REPO)
2326
volumeMounts:
2427
- name: githubtoken
2528
mountPath: /etc/github-set-status
@@ -31,7 +34,7 @@ spec:
3134
-H "Authorization: Bearer $(cat /etc/github-set-status/token)" \
3235
-H "Content-Type: application/json" \
3336
-H "X-GitHub-Api-Version: 2022-11-28" \
34-
"https://api.github.com/repos/instana/python-sensor/statuses/${SHA}" \
37+
"https://api.github.com/repos/${REPO}/statuses/${SHA}" \
3538
-d '{
3639
"state":"'${STATE}'",
3740
"target_url":"http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/namespaces/default/pipelineruns/",

0 commit comments

Comments
 (0)