def get_decision_parameters()

in taskcluster/glean_taskgraph/__init__.py [0:0]


def get_decision_parameters(graph_config, parameters):
    parameters["head_tag"] = ''
    if parameters["tasks_for"] == "github-release":
        head_tag = os.environ.get("GLEAN_HEAD_TAG")
        if head_tag is None:
            raise ValueError("Cannot run github-release if the environment variable "
                             "'GLEAN_HEAD_TAG' is not defined")
        parameters["head_tag"] = head_tag
        version = get_version()
        # XXX: tags are in the format of `v<semver>`
        if head_tag[1:] != version:
            raise ValueError(
                "Cannot run github-release if tag {} is different than in-tree "
                "{version} from buildconfig.yml".format(head_tag[1:], version)
            )
    elif parameters["tasks_for"] == "github-pull-request":
        pr_title = os.environ.get("GLEAN_PULL_REQUEST_TITLE", "")
        if "[ci full]" in pr_title:
            parameters["target_tasks_method"] = "pr-full"
        elif "[ci skip]" in pr_title:
            parameters["target_tasks_method"] = "pr-skip"
        else:
            parameters["target_tasks_method"] = "pr-normal"