Skip to content

Commit

Permalink
Disable results
Browse files Browse the repository at this point in the history
  • Loading branch information
rbo committed Jan 3, 2025
1 parent 49aff99 commit 839cbc7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .tekton/task/github-add-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ spec:
optional: true
description: The optional workspace containing comment file to be posted.

results:
- name: OLD_COMMENT
description: The old text of the comment, if any.
# results:
# - name: OLD_COMMENT
# description: The old text of the comment, if any.

- name: NEW_COMMENT
description: The new text of the comment, if any.
# - name: NEW_COMMENT
# description: The new text of the comment, if any.

params:
- name: GITHUB_HOST_URL
Expand Down Expand Up @@ -167,8 +167,8 @@ spec:
# If more than one comment is found take the last one
matching_comment = [x for x in comments if '$(params.COMMENT_TAG)' in x['body']][-1:]
if matching_comment:
with open("$(results.OLD_COMMENT.path)", "w") as result_old:
result_old.write(str(matching_comment[0]))
# with open("$(results.OLD_COMMENT.path)", "w") as result_old:
# result_old.write(str(matching_comment[0]))
matching_comment = matching_comment[0]['url']
if matching_comment:
Expand All @@ -195,7 +195,7 @@ spec:
print(resp.read())
sys.exit(1)
else:
with open("$(results.NEW_COMMENT.path)", "wb") as result_new:
result_new.write(resp.read())
# with open("$(results.NEW_COMMENT.path)", "wb") as result_new:
# result_new.write(resp.read())
print("a GitHub comment has been {} to $(params.REQUEST_URL)".format(
"updated" if matching_comment else "added"))

0 comments on commit 839cbc7

Please sign in to comment.