ansys.tools.repo_sync#

Tool to synchronize the content of different repositories.

Submodules#

Package Contents#

Functions#

synchronize(→ Union[str, None])

Synchronize a folder to a remote repository.

ansys.tools.repo_sync.synchronize(owner: str, repository: str, token: str, from_dir: str, to_dir: str, include_manifest: str, branch_checked_out: str = 'main', clean_to_dir: bool = False, clean_to_dir_based_on_manifest: bool = False, dry_run: bool = False, skip_ci: bool = False, random_branch_name: bool = False) str | None#

Synchronize a folder to a remote repository.

Parameters:
ownerstr

Repository owner (user or organization).

repositorystr

Repository name.

tokenstr

GitHub access token.

from_dirstr

Directory from which files want to be synced.

to_dirstr

Directory to which files want to be synced (w.r.t. the root of the repository).

include_manifeststr

Path to manifest which mentions accepted extension files.

branch_checked_outstr, optional

Branch to check out, by default “main”.

clean_to_dirbool, optional

Delete the content inside the directory where the files will be synced, by default False.

clean_to_dir_based_on_manifestbool, optional

In case clean_to_dir is requested, perform the cleanup of files that match the regex in the manifest. By default, False. If clean_to_dir is False, this option will not have an effect.

dry_runbool, optional

Simulate the behavior of the synchronization without performing it, by default False.

skip_cibool, optional

Whether to add a [skip ci] prefix to the commit message or not. By default False.

random_branch_namebool, optional

For testing purposes - generates a random suffix for the branch name sync/file-sync.

Returns:
Union[str, None]

Pull request URL. In case of dry-run or no files modified, None is returned.