<commit_before>"use strict";
var http = require('http'),
	github = require('./github.js'),
	config = require('./config.js'),
	autopr = require('./git-api.js')[1],
	log = require('./logger.js'),
	teamMembers = config.teamMembers,
	state, branch,
	server = http.createServer(function(req, res) {
		var response = [];
		if (req.method === "POST" && req.headers && (/^GitHub/).test(req.headers["user-agent"])) {
			req.on('data', function(data) {
				response.push(data.toString("utf-8"));

			});
			req.on('end', function() {
				var data = response.join("");
				data = JSON.parse(data.toString('utf-8'));

				if (data.pusher) {
					var user = data.pusher.name;
//					if (data.commits[0]) {
						var commitMessage = data.commits[0].message,
							sha = data.commits[0].id;
//					}
					var release_branch = data.ref.replace(/^refs\/heads\//, "");

					if ((/^r\d\.([1-9]|1[0-2])\.([0-9]|1[1-2])\d*$/).test(release_branch)) {
						if (data.created) {
							state = "opened";
							log.i(user, state, release_branch);
							github.autostage(state, release_branch, 527, "release");
						} else if (!data.created && !data.deleted) {
							state = "hotfix";
							log.i(user, state, release_branch);
							log.i("create auto pr only for " + sha + " commit");
							github.hotfix(sha, user);
							return;
						} else return;
					} else if (data.pusher.name === "scrollbackbot") {
						state = "auto PR with this commit only";
						log.i(user, state, release_branch);
						autopr(release_branch, commitMessage);
					}
				} else if (data.pull_request) {
					var user = data.sender.login,
						pullRequestNo = data.pull_request.number;
					branch = data.pull_request.head.ref;
					state = data.action;
					log.i(user, state, branch);
					if (teamMembers.indexOf(user) < 0) return;
					github.autostage(state, branch, pullRequestNo);<commit_msg>put a check<commit_after>"use strict";
var http = require('http'),
	github = require('./github.js'),
	config = require('./config.js'),
	autopr = require('./git-api.js')[1],
	log = require('./logger.js'),
	teamMembers = config.teamMembers,
	state, branch,
	server = http.createServer(function(req, res) {
		var response = [];
		if (req.method === "POST" && req.headers && (/^GitHub/).test(req.headers["user-agent"])) {
			req.on('data', function(data) {
				response.push(data.toString("utf-8"));

			});
			req.on('end', function() {
				var data = response.join("");
				data = JSON.parse(data.toString('utf-8'));

				if (data.pusher) {
					var user = data.pusher.name;
					if (data.commits.length) {
						var commitMessage = data.commits[0].message,
							sha = data.commits[0].id;
					}
					var release_branch = data.ref.replace(/^refs\/heads\//, "");

					if ((/^r\d\.([1-9]|1[0-2])\.([0-9]|1[1-2])\d*$/).test(release_branch)) {
						if (data.created) {
							state = "opened";
							log.i(user, state, release_branch);
							github.autostage(state, release_branch, 527, "release");
						} else if (!data.created && !data.deleted) {
							state = "hotfix";
							log.i(user, state, release_branch);
							log.i("create auto pr only for " + sha + " commit");
							github.hotfix(sha, user);
							return;
						} else return;
					} else if (data.pusher.name === "scrollbackbot") {
						state = "auto PR with this commit only";
						log.i(user, state, release_branch);
						autopr(release_branch, commitMessage);
					}
				} else if (data.pull_request) {
					var user = data.sender.login,
						pullRequestNo = data.pull_request.number;
					branch = data.pull_request.head.ref;
					state = data.action;
					log.i(user, state, branch);
					if (teamMembers.indexOf(user) < 0) return;
					github.autostage(state, branch, pullRequestNo);
{'fraction_non_alphanumeric': 0.18793565683646113, 'fraction_numerical': 0.010455764075067025, 'mean_word_length': 2.886458333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '269528', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1276, 'n_words': 249}