From 1f88fad50eb7412e27e0db2c4e37cb9e982ffa80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 25 May 2021 17:30:57 +0200 Subject: [PATCH] gitlab: Use $CI_DEFAULT_BRANCH instead of hardcoded 'master' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We want to skip the checkpatch and DCO signoff jobs when pushing to the default branch. Currently this branch is called 'master', but we don't need to hardcode this in the CI configuration, because the $CI_DEFAULT_BRANCH env variable exposes it. References: - https://sfconservancy.org/news/2020/jun/23/gitbranchname/ - https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/ Suggested-by: Savitoj Singh Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210525153826.4174157-1-philmd@redhat.com> Reviewed-by: Daniel P. Berrangé Reviewed-by: Willian Rampazzo --- .gitlab-ci.d/static_checks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml index f695627b7cd..9c9a771b744 100644 --- a/.gitlab-ci.d/static_checks.yml +++ b/.gitlab-ci.d/static_checks.yml @@ -6,7 +6,7 @@ check-patch: script: .gitlab-ci.d/check-patch.py except: variables: - - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master' + - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH variables: GIT_DEPTH: 1000 allow_failure: true @@ -19,6 +19,6 @@ check-dco: script: .gitlab-ci.d/check-dco.py except: variables: - - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master' + - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH variables: GIT_DEPTH: 1000 -- 2.39.5