OPRF Asset Updater#

GitHub Action#

The most common usage of this module is through the OPRF Asset Updater GitHub action. Documentation can be found in marketplace listing or the repository readme.

CLI Usage#

A script which automatically updates OPRF standard asset files from the OpRedFlag repository

usage: oprf update [-h] [-d DIRECTORY] [-r REPOSITORY] [-b BRANCH]
                   [-v VERSION_JSON] [-i INCLUDE] [-e EXCLUDE]
                   [-c {major,minor,patch,none}] [-s]

Named Arguments#

-d, --directory

Local root directory

Default: “.”

-r, --repository

Location of OpRedFlag asset GitHub repository, in User/Repo format. Default: “NikolaiVChr/OpRedFlag”

Default: “NikolaiVChr/OpRedFlag”

-b, --branch

The branch of the OpRedFlag repository to use. Default: “master”

Default: “master”

-v, --version-json

Location of local versions.json file. Default: “oprf-versions.json”

Default: “oprf-versions.json”

-i, --include

Files to update, separated by commas. Default: “*”

Default: “*”

-e, --exclude

Files to skip, separated by commas. Default: “”

Default: “”

-c, --compatibility

Possible choices: major, minor, patch, none

Compatibility level, will only allow updates of this level or lower. Default “minor”

Default: minor

-s, --strict

Fail if local file versions are newer than remote

Default: False

Code Reference#

class opredflag.updater.Updater(directory='.', version_json='oprf-versions.json', repository='NikolaiVChr/OpRedFlag', branch='master', include='*', exclude='', compatibility=Compatibility.MINOR, strict=False)[source]#

The base updater class which handles the whole process.

Parameters:
  • directory (str) – Local root directory

  • version_json (str) – Location of local versions.json file

  • repository (str) – Location of OpRedFlag asset GitHub repository, in User/Repo format

  • branch (str) – The branch of the repository to use

  • include (str) – Files to update, separated by commas

  • exclude (str) – Files to skip, separated by commas

  • compatibility (Compatibility) – Compatibility level, will only allow updates of this level or lower

  • strict (bool) – Fail if local file versions are newer than remote

await run()[source]#

Run the update.

Returns:

The script output, split by newlines

Return type:

list[str]

class opredflag.updater.Compatibility[source]#

Represents a compatibility level between semantic versions.

MAJOR#

Compatibility with any major version, least strict.

MINOR#

Compatibility with any minor version with the same major version, less strict.

PATCH#

Compatibility with any patch version with the same major and minor version, most strict.