<commit_before>// Handle finished build jobs and trigger a deployment if configured.
package deployment

import (
	"leeroy/config"
	"leeroy/logging"
	"log"
)

// Check if the branch that was just build is configured for continuous
// deployment and trigger a deploy.
// Returns true if a deployment is triggered.
func ContinuousDeploy(j *logging.Job, c *config.Config) bool {
	r, err := c.ConfigForRepo(j.URL)

	if err != nil {
		log.Println("Cannot deploy", j.Branch, "repository not found.")
		return false
	}

	for _, d := range r.Deploy {
		if d.Branch == j.Branch {
			log.Println("deploying", d.Branch)
			go Deploy(j, c)
			return true
		}
	}

	return false
}<commit_msg>use DeployTarget() to check if a branch should be deployed<commit_after>// Handle finished build jobs and trigger a deployment if configured.
package deployment

import (
	"leeroy/config"
	"leeroy/logging"
	"log"
)

// Check if the branch that was just build is configured for continuous
// deployment and trigger a deploy.
// Returns true if a deployment is triggered.
func ContinuousDeploy(j *logging.Job, c *config.Config) bool {
	r, err := c.ConfigForRepo(j.URL)

	if err != nil {
		log.Println("Cannot deploy", j.Branch, "repository not found.")
		return false
	}

	_, err = r.DeployTarget(j.Branch)

	if err != nil {
		return false
	}

	log.Println("deploying", j.Branch)

	go Deploy(j, c)

	return true
}
{'fraction_non_alphanumeric': 0.11087113030957524, 'fraction_numerical': 0.0, 'mean_word_length': 3.6333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2452846', 'n_tokens_mistral': 469, 'n_tokens_neox': 450, 'n_words': 161}