Skip to content

info

frequenz.repo.config.cli.version.mike.info ¤

Command-line tool to get the current mike version information of a repository.

For now this tool is designed to be used in GitHub Actions workflows, but is is possible to use it in other environments as well. To do so the gh tool should be properly configured and have at least read-access to the repository, and the following environment variables should be set:

  • GITHUB_REPO: The repository to get the version information of (e.g. frequenz-floss/frequenz-sdk-python).
  • GIT_REF: The git reference to get the version information of (e.g. refs/heads/v1.x.x).
  • GIT_SHA: The git sha to get the version information of (e.g. 84df6ad1d9990d7afd47a9f8e8a386702b09eba0).
  • TAGS: The tags of the repository (e.g. v1.0.0 v1.0.1).
  • BRANCHES: The branches of the repository (e.g. v1.x.x v2.x.x).
  • GITHUB_OUTPUT: The output variable to set the version information to (e.g. /dev/stdout).

Functions¤

frequenz.repo.config.cli.version.mike.info.main ¤

main() -> None

Output mike version variables for GitHub Actions.

Source code in frequenz/repo/config/cli/version/mike/info.py
def main() -> None:
    """Output mike version variables for GitHub Actions."""
    github.configure_logging()

    try:
        mike_version = mike.build_mike_version(github.get_repo_version_info())
    except ValueError as error:
        gha.warning(
            f"{error}.", title="Could not determine the version information for `mike`"
        )
        return

    _output_gha_vars(mike_version)