public function updateChangelog(string $version)
    {
        $changelog = sprintf(self::TEMPLATE, $version);
        $contents = file_get_contents($this->changelogFile);
        $contents = preg_replace(
            "/^(\# Changelog\n\n.*?)(\n\n\#\# )/s",
            '$1' .  $changelog . '## ',
            $contents
        );
        file_put_contents($this->changelogFile, $contents);
    }