in src/Saas.Lib/Deployment.Script.Modules/patch-github-workflow.py [0:0]
def patch_workflow(app_name: str, config_file: str, workflow_yaml: str) -> None:
with open(config_file, 'r') as f_json:
config_json = json.load(f_json)
web_app_name = get_app_value(config_json, app_name, "appServiceName")
yaml=YAML()
yaml.preserve_quotes = True
yaml.indent(mapping=2, sequence=4, offset=2)
yaml.explicit_start = True
with open(workflow, 'r') as stream:
workflow_yaml = yaml.load(stream)
env = workflow_yaml['env']
env.update(dict(APP_NAME = app_name))
env.update(dict(AZURE_WEBAPP_NAME = web_app_name))
with open(workflow, 'w+') as stream:
yaml.dump(workflow_yaml, stream)