Skip to content
Snippets Groups Projects
Commit 766758bb authored by Alex Iribarren's avatar Alex Iribarren
Browse files

Make messages nicer, alert @all

parent 7fb92613
No related branches found
No related tags found
No related merge requests found
Pipeline #4490234 passed
......@@ -117,7 +117,7 @@ def format_release(release, f):
values = {}
# Using Mattermost attachments for prettier messages
# https://developers.mattermost.com/integrate/admin-guide/admin-message-attachments/
values['pretext'] = f"{f}: **{release['title']}**"
values['pretext'] = f"@all new package released in {f}: **{release['title']}**"
# Let's grab just the changelog from the summary
summary = release['summary'].split('\n')
......@@ -129,8 +129,14 @@ def format_release(release, f):
if notes:
values['fields'] = [{'title': 'Notes', 'value': notes, 'short': False}]
response = requests.post(mattermost_integration_url, json={'attachments': [values]})
payload = {
'username': 'Newsguin, Reader of Feeds',
'icon_url': 'https://airibarr.web.cern.ch/airibarr/robotpenguin.png',
'attachments': [values],
}
response = requests.post(mattermost_integration_url, json=payload)
print(f" -- Sent notification to Mattermost, response code was {response.status_code}")
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment