@@ -14,14 +14,14 @@ inputs:
14
14
runs :
15
15
using : " composite"
16
16
steps :
17
- - name : restrict action to labelled issues and issue comments
17
+ - name : restrict action to labelled issues
18
18
run : |
19
19
set -eux
20
20
21
21
echo "NeedsJiraUpdate=false" >> $GITHUB_ENV
22
22
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."
25
25
exit 1
26
26
fi
27
27
67
67
title : ${{ github.event.issue.title }}
68
68
body : ${{ github.event.issue.body }}
69
69
author : ${{ github.event.issue.user.login }}
70
- commentAuthor : ${{ github.actor }}
71
- comment : ${{ github.event.comment.body }}
72
70
run : |
73
71
set -eux
74
72
@@ -82,15 +80,15 @@ runs:
82
80
83
81
sudo apt install -y python3-mistletoe
84
82
echo ${body} > $TMPDIR/body.md
85
- echo ${comment} > $TMPDIR/comment.md
86
83
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)
88
84
fi
89
85
90
86
description="${body}
91
87
88
+
89
+ GitHub URL: ${id}.
90
+
92
91
Opened by ${author}."
93
- commentContent=""
94
92
95
93
# Choose Jira action based on event type and action.
96
94
action=""
@@ -106,27 +104,17 @@ runs:
106
104
elif [ ${{ github.event.action }} == "closed" ]; then
107
105
action=Close
108
106
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}"
118
107
fi
119
108
120
- echo "PUSHING: $id $action $title $description $commentContent "
109
+ echo "PUSHING: $id $action $title $description"
121
110
122
111
# Push to Jira as a json data format.
123
112
data=$(jq -n \
124
113
--arg id "$id" \
125
114
--arg action "$action" \
126
115
--arg title "$title" \
127
116
--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}}')
130
118
curl -X POST -H 'Content-type: application/json' --data "${data}" '${{ inputs.webhook-url }}'
131
119
132
120
shell : bash
0 commit comments