Skip to content

Commit f99d28b

Browse files
Extract jira ticket numbers (AST-000)
1 parent 2040fb4 commit f99d28b

File tree

1 file changed

+81
-63
lines changed

1 file changed

+81
-63
lines changed

.github/workflows/release-notify.yml

Lines changed: 81 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -84,73 +84,91 @@ jobs:
8484
echo "formatted_contributors=$formatted_contributors" >> $GITHUB_OUTPUT
8585
echo "escaped_contributors_links=escaped_contributors_links" >> $GITHUB_OUTPUT
8686

87+
- name: Extract Jira Ticket IDs
88+
id: extract_jira_tickets
89+
run: |
90+
jira_tickets=$(echo "${{ steps.fetch_release_notes.outputs.release_notes }}" | grep -oE 'AST-[0-9]+' | sort -u)
91+
92+
echo "Jira Tickets:"
93+
94+
for ticket in $jira_tickets; do
95+
echo "$ticket"
96+
done
97+
98+
# Format Jira tickets as a comma-separated list
99+
formatted_jira_tickets=$(echo "$jira_tickets" | tr '\n' ', ' | sed 's/, $//')
100+
101+
echo "Formatted Jira Tickets: $formatted_jira_tickets"
102+
103+
echo "formatted_jira_tickets=$formatted_jira_tickets" >> $GITHUB_OUTPUT
104+
87105

88-
- name: Send notification to Teams
89-
uses: Skitionek/[email protected]
90-
with:
91-
webhook_url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
92-
raw: >
93-
{
94-
"type": "message",
95-
"attachments": [
96-
{
97-
"contentType": "application/vnd.microsoft.card.adaptive",
98-
"content": {
99-
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
100-
"type": "AdaptiveCard",
101-
"version": "1.4",
102-
"msteams": {
103-
"width": "Full"
104-
},
105-
"body": [
106-
{
107-
"type": "TextBlock",
108-
"text": "New Release: **${{ inputs.product_name }} - ${{ inputs.release_version }}**",
109-
"weight": "Bolder",
110-
"size": "Medium"
111-
},
112-
{
113-
"type": "FactSet",
114-
"facts": [
115-
{ "title": "Product:", "value": "${{ inputs.product_name }}" },
116-
{ "title": "Version:", "value": "${{ inputs.release_version }}" },
117-
{ "title": "CLI Version:", "value": "${{ inputs.cli_release_version }}" },
118-
{ "title": "Contributors:", "value": "${{ steps.extract_contributors.outputs.formatted_contributors }}" }
119-
]
120-
},
121-
{
122-
"type": "TextBlock",
123-
"text": ${{ steps.sanitize_release_notes.outputs.sanitized_release_notes }},
124-
"wrap": true
125-
}
126-
],
127-
"actions": [
128-
{
129-
"type": "Action.OpenUrl",
130-
"title": "View Release",
131-
"url": "${{ inputs.release_url }}"
132-
}
133-
]
134-
}
135-
}
136-
]
137-
}
106+
# - name: Send notification to Teams
107+
# uses: Skitionek/[email protected]
108+
# with:
109+
# webhook_url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
110+
# raw: >
111+
# {
112+
# "type": "message",
113+
# "attachments": [
114+
# {
115+
# "contentType": "application/vnd.microsoft.card.adaptive",
116+
# "content": {
117+
# "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
118+
# "type": "AdaptiveCard",
119+
# "version": "1.4",
120+
# "msteams": {
121+
# "width": "Full"
122+
# },
123+
# "body": [
124+
# {
125+
# "type": "TextBlock",
126+
# "text": "New Release: **${{ inputs.product_name }} - ${{ inputs.release_version }}**",
127+
# "weight": "Bolder",
128+
# "size": "Medium"
129+
# },
130+
# {
131+
# "type": "FactSet",
132+
# "facts": [
133+
# { "title": "Product:", "value": "${{ inputs.product_name }}" },
134+
# { "title": "Version:", "value": "${{ inputs.release_version }}" },
135+
# { "title": "CLI Version:", "value": "${{ inputs.cli_release_version }}" },
136+
# { "title": "Contributors:", "value": "${{ steps.extract_contributors.outputs.formatted_contributors }}" }
137+
# ]
138+
# },
139+
# {
140+
# "type": "TextBlock",
141+
# "text": ${{ steps.sanitize_release_notes.outputs.sanitized_release_notes }},
142+
# "wrap": true
143+
# }
144+
# ],
145+
# "actions": [
146+
# {
147+
# "type": "Action.OpenUrl",
148+
# "title": "View Release",
149+
# "url": "${{ inputs.release_url }}"
150+
# }
151+
# ]
152+
# }
153+
# }
154+
# ]
155+
# }
138156

139157

140158
- name: Get Current Date
141159
id: current-date
142160
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_ENV
143161

144-
- name: Send payload to JIRA Automation Webhook
145-
uses: satak/webrequest-action@master
146-
with:
147-
url: ${{ secrets.JIRA_RELEASE_WEBHOOK_URL }}
148-
method: POST
149-
payload: |
150-
{
151-
"data": {
152-
"version": "${{ inputs.jira_product_name }}_${{ inputs.release_version }}",
153-
"startDate": "${{ env.date }}",
154-
"date": "${{ env.date }}"
155-
}
156-
}
162+
# - name: Send payload to JIRA Automation Webhook
163+
# uses: satak/webrequest-action@master
164+
# with:
165+
# url: ${{ secrets.JIRA_RELEASE_WEBHOOK_URL }}
166+
# method: POST
167+
# payload: |
168+
# {
169+
# "data": {
170+
# "version": "${{ inputs.jira_product_name }}_${{ inputs.release_version }}",
171+
# "startDate": "${{ env.date }}",
172+
# "date": "${{ env.date }}"
173+
# }
174+
# }

0 commit comments

Comments
 (0)