Skip to content

Commit

Permalink
Fix github-tasks-completed
Browse files Browse the repository at this point in the history
We just added a Tekton Task that checks that the
GitHub Tasks have been completed in pull requests.

In this change, we:
* fix the namespace - it's `tekton-ci` not `tektonci`
* import os in the python script
* fix the query string, needs space between brackets

Related PR:
* tektoncd#911
  • Loading branch information
jerop committed Jan 13, 2022
1 parent 46e9708 commit 025338f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tekton/ci/jobs/tekton-github-tasks-completed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: github-tasks-completed
namespace: tektonci
namespace: tekton-ci
description: |
Verifies that a PR has all the tasks completed. A task is considered to be any part of the text that looks like a github markdown checkbox ("- []").
spec:
Expand All @@ -25,8 +25,9 @@ spec:
script: |
#!/usr/bin/env python
import sys
import os
prBodyText = os.getenv('PULL_REQUEST_BODY')
incompleteTasks = prBodyText.count("\n- []")
incompleteTasks = prBodyText.count("\n- [ ]")
if incompleteTasks > 0:
msg = "Error: {} incomplete GitHub Tasks found, expecting no incomplete GitHub Tasks".format(incompleteTasks)
print(msg)
Expand All @@ -40,7 +41,7 @@ apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: tekton-github-tasks-completed
namespace: tektonci
namespace: tekton-ci
spec:
params:
- name: checkName
Expand Down

0 comments on commit 025338f

Please sign in to comment.