From c5acad73b43f53973e49265632a450e38d8fc08f Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 28 Mar 2023 07:56:37 +0000 Subject: [PATCH 1/2] Prevent incorrectly setting DEV_BRANCH DEV_BRANCH is used to change archive upload behavior. We current code it was incorrectly considering being on a dev branch while on main one (main) --- .github/scripts/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/common.py b/.github/scripts/common.py index de84d13..ddbdf88 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -39,7 +39,7 @@ _ref = _environ.get("GITHUB_REF", "").split("/")[-1] MAKE_RELEASE = re.fullmatch(r"r_[0-9]+", _ref) is not None MAKE_RELEASE = MAKE_RELEASE and (_environ.get('GITHUB_EVENT_NAME') != 'schedule') -if not MAKE_RELEASE and _ref != "master": +if not MAKE_RELEASE and _ref != "main": DEV_BRANCH = _ref else: DEV_BRANCH = None From 7c02c6b778227532dbb5fdcd36390b6b6203e4a7 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 28 Mar 2023 07:58:41 +0000 Subject: [PATCH 2/2] Fixed triggering workflows on zim-tools and kiwix-tools Both the fallback and the passed ref were targeting the master branch of those repositories. This triggers the workflow on their main branch and sets the default target branch to main as all our repositories use it. --- .github/scripts/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/common.py b/.github/scripts/common.py index ddbdf88..54c35f9 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -455,7 +455,7 @@ def fix_macos_rpath(project): subprocess.check_call(command, env=os.environ) -def trigger_workflow(repo, workflow="docker.yml", ref="master", inputs=None): +def trigger_workflow(repo, workflow="docker.yml", ref="main", inputs=None): """triggers a `workflow_dispatch` event to the specified workflow on its repo repo: {user}/{repo} format @@ -491,7 +491,7 @@ def trigger_docker_publish(target): "kiwix-tools": "kiwix/kiwix-tools"}.get(target) try: - trigger_workflow(repo, workflow="docker.yml", ref="master", + trigger_workflow(repo, workflow="docker.yml", ref="main", inputs={"version": version}) print_message("triggered docker workflow on {repo}", repo=repo) except Exception as exc: