Skip to content

Commit 2dfac3b

Browse files
committed
Removed action on issue comment
1 parent f4a912c commit 2dfac3b

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

.github/actions/sync_with_jira/action.yaml

+8-20
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ inputs:
1414
runs:
1515
using: "composite"
1616
steps:
17-
- name: restrict action to labelled issues and issue comments
17+
- name: restrict action to labelled issues
1818
run: |
1919
set -eux
2020
2121
echo "NeedsJiraUpdate=false" >> $GITHUB_ENV
2222
23-
if [ ${{ github.event_name }} != "issues" ] && [ ${{ github.event_name }} != "issue_comment" ]; then
24-
echo "This action only work on issue events. Please use on: issues or issue_comment to use this action."
23+
if [ ${{ github.event_name }} != "issues" ]; then
24+
echo "This action only work on issue events. Please use on: issues to use this action."
2525
exit 1
2626
fi
2727
@@ -67,8 +67,6 @@ runs:
6767
title: ${{ github.event.issue.title }}
6868
body: ${{ github.event.issue.body }}
6969
author: ${{ github.event.issue.user.login }}
70-
commentAuthor: ${{ github.actor }}
71-
comment: ${{ github.event.comment.body }}
7270
run: |
7371
set -eux
7472
@@ -82,15 +80,15 @@ runs:
8280
8381
sudo apt install -y python3-mistletoe
8482
echo ${body} > $TMPDIR/body.md
85-
echo ${comment} > $TMPDIR/comment.md
8683
body=$(PYTHONPATH=/usr/share/doc/python3-mistletoe mistletoe -r examples.jira_renderer.JIRARenderer $TMPDIR/body.md)
87-
comment=$(PYTHONPATH=/usr/share/doc/python3-mistletoe mistletoe -r examples.jira_renderer.JIRARenderer $TMPDIR/comment.md)
8884
fi
8985
9086
description="${body}
9187
88+
89+
GitHub URL: ${id}.
90+
9291
Opened by ${author}."
93-
commentContent=""
9492
9593
# Choose Jira action based on event type and action.
9694
action=""
@@ -106,27 +104,17 @@ runs:
106104
elif [ ${{ github.event.action }} == "closed" ]; then
107105
action=Close
108106
fi
109-
else
110-
action=AddComment
111-
if [ ${{ github.event.action }} == "deleted" ]; then
112-
echo "Deleting comment on Jira is not supported ATM, skipping."
113-
exit 0
114-
fi
115-
# For now, editing comments will add a new one on Jira.
116-
commentContent="From ${commentAuthor}:
117-
${comment}"
118107
fi
119108
120-
echo "PUSHING: $id $action $title $description $commentContent"
109+
echo "PUSHING: $id $action $title $description"
121110
122111
# Push to Jira as a json data format.
123112
data=$(jq -n \
124113
--arg id "$id" \
125114
--arg action "$action" \
126115
--arg title "$title" \
127116
--arg description "$description" \
128-
--arg commentContent "$commentContent" \
129-
'{data: {id: $id, action: $action, title: $title, description: $description, commentContent: $commentContent}}')
117+
'{data: {id: $id, action: $action, title: $title, description: $description}}')
130118
curl -X POST -H 'Content-type: application/json' --data "${data}" '${{ inputs.webhook-url }}'
131119
132120
shell: bash

.github/workflows/sync_with_jira.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Sync GitHub issues to Jira example
2-
on: [issues, issue_comment]
2+
on: [issues]
33

44
jobs:
55
sync-issues:

0 commit comments

Comments
 (0)