<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python Example for Python GitHub Webhooks
# File: push-myrepo-master

import sys
import json
import bot

with open(sys.argv[1], 'r') as jsf:
    payload = json.loads(jsf.read())

with open(sys.argv[3], 'r') as jsf:
    config = json.loads(jsf.read())

bot = bot.Bot()

user_link = payload['sender']['html_url'].replace('https://github.com/', '')
tag_link = payload['release']['html_url'].replace('https://github.com/', '')
repo_link = payload['repository']['html_url'].replace('https://github.com/', '')

params = {
    'username': payload['sender']['login'],
    'user_link': config['server_url'] + '/redirect/' + sys.argv[2] + '/' + user_link,
    'tag': payload['release']['tag_name'],
    'tag_link': config['server_url'] + '/redirect/' + sys.argv[2] + '/' + tag_link,
    'repository_name': payload['repository']['full_name'],
    'repository_link': config['server_url'] + '/redirect/' + sys.argv[2] + '/' + repo_link,
}
message = False
if payload['action'] == 'published':
    message = "🚀 [{username}]({user_link}) added tag [{tag}]({tag_link}) to [{repository_name}]({repository_link})"
    message = message.format(**params)
pprint(payload['action'])

if (message):
    bot.send_message(message)<commit_msg>Remove lost pprint<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python Example for Python GitHub Webhooks
# File: push-myrepo-master

import sys
import json
import bot

with open(sys.argv[1], 'r') as jsf:
    payload = json.loads(jsf.read())

with open(sys.argv[3], 'r') as jsf:
    config = json.loads(jsf.read())

bot = bot.Bot()

user_link = payload['sender']['html_url'].replace('https://github.com/', '')
tag_link = payload['release']['html_url'].replace('https://github.com/', '')
repo_link = payload['repository']['html_url'].replace('https://github.com/', '')

params = {
    'username': payload['sender']['login'],
    'user_link': config['server_url'] + '/redirect/' + sys.argv[2] + '/' + user_link,
    'tag': payload['release']['tag_name'],
    'tag_link': config['server_url'] + '/redirect/' + sys.argv[2] + '/' + tag_link,
    'repository_name': payload['repository']['full_name'],
    'repository_link': config['server_url'] + '/redirect/' + sys.argv[2] + '/' + repo_link,
}
message = False
if payload['action'] == 'published':
    message = "🚀 [{username}]({user_link}) added tag [{tag}]({tag_link}) to [{repository_name}]({repository_link})"
    message = message.format(**params)


if (message):
    bot.send_message(message)
{'fraction_non_alphanumeric': 0.2222222222222222, 'fraction_numerical': 0.004728132387706856, 'mean_word_length': 4.918414918414919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3575047', 'n_tokens_mistral': 844, 'n_tokens_neox': 855, 'n_words': 162}