RAPTOR v18.4: Исправлена отчетность, активированы выходные
This commit is contained in:
28
invest-python-master/scripts/update_issue_templates.py
Normal file
28
invest-python-master/scripts/update_issue_templates.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
def add_version(version: str, file: str) -> None:
|
||||
with open(file, "r", encoding="utf-8") as f:
|
||||
data = yaml.safe_load(f)
|
||||
for field in data["body"]:
|
||||
if field.get("id", "") == "package-version":
|
||||
field["attributes"]["options"] = [
|
||||
version,
|
||||
*field["attributes"]["options"],
|
||||
]
|
||||
with open(file, "w+", encoding="utf-8") as f:
|
||||
yaml.dump(
|
||||
data, f, default_flow_style=False, sort_keys=False, allow_unicode=True
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
version = sys.argv[1]
|
||||
add_version(version, ".github/ISSUE_TEMPLATE/bug_report.yaml")
|
||||
add_version(version, ".github/ISSUE_TEMPLATE/issue.yaml")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user