devops.files.update_changelog

Module for updating the changelog file.

Functions

get_repo_url()

Return the GitHub URL of the current repository.

update_changelog(version, changelog_path[, ...])

Update the changelog file with a new version entry.

Exceptions

DevOpsChangelogError(message)

Base class for changelog related errors.

exception devops.files.update_changelog.DevOpsChangelogError(message)[source]

Bases: Exception

Base class for changelog related errors.

Parameters:

message (str)

Return type:

None

devops.files.update_changelog.get_repo_url()[source]

Return the GitHub URL of the current repository.

Uses GITHUB_REPOSITORY (and GITHUB_SERVER_URL) when set, as in GitHub Actions, and the origin remote otherwise.

Returns:

str – The repository URL, for example https://github.com/MolarVerse/devops.

Raises:

DevOpsChangelogError – If the repository cannot be determined.

Return type:

str

devops.files.update_changelog.update_changelog(version, changelog_path, repo_url=None)[source]

Update the changelog file with a new version entry.

Parameters:
  • version (str) – The new version to add to the changelog.

  • changelog_path (Path) – The path to the changelog file.

  • repo_url (str | None) – The GitHub URL used for the release link. Defaults to get_repo_url().

Raises:
  • DevOpsFileNotFoundError – If the changelog file does not exist. Happens inside open_file.

  • DevOpsChangelogError – If the “## Next Release” marker is not found in the changelog or the repository URL cannot be determined.

Return type:

None