We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be nice to have google chats alerts Integrated as well. I have already written a code for same, please have a look and get it added in
import json import requests def google_chat_post(url, json_message): """Post to Google Chat webhook.""" headers = { 'Content-Type': 'application/json' } requests.post(url, headers = headers, json = json_message) def google_chat_alert(filename, sha2, base_url, message): """Send Google Chat alert.""" url = os.environ.get('GOOGLE_CHAT_WEBHOOK_URL', settings.GOOGLE_CHAT_WEBHOOK_URL) if not url: return severity, total_issues = filters.get_metrics(message) total_files = len(message['files']) scan_file = filename error = severity['error'] warning = severity['warning'] info = severity['info'] json_message = { 'cards': [{ 'header': { 'title': f'nodejsscan v{settings.VERSION}', 'subtitle': f'Scan Completed on: {utils.get_timestamp()}', }, 'sections': [{ 'widgets': [{ 'textParagraph': { 'text': (f'Found {total_issues} issues in {total_files} files\n' f'nodejsscan finished analyzing: {scan_file}'), }},{ 'buttons': [{ 'textButton': { 'text': 'See Scan Results', 'onClick': { 'openLink': { 'url': f'{base_url}scan/{sha2}', }, }, }, }], }], }, { 'widgets': [{ 'keyValue': { 'topLabel': 'Severity Distribution', 'content': f':octagonal_sign: ERROR: {error}\n:warning: WARNING: {warning}\n:information_source: INFO: {info}', }, }], }], }], } process = Thread(target = google_chat_post, args = (url, json_message)) process.start() process.join()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be nice to have google chats alerts Integrated as well.
I have already written a code for same, please have a look and get it added in
The text was updated successfully, but these errors were encountered: