diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/make.py b/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/make.py index e50a4d5c3bd64..b8a09cf398558 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/make.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/make.py @@ -23,8 +23,9 @@ @click.option('--skip-sign', is_flag=True, help='Skip the signing of release metadata') @click.option('--sign-only', is_flag=True, help='Only sign release metadata') @click.option('--exclude', help='Comma-separated list of checks to skip') +@click.option('--allow-master', is_flag=True, help='Allow ddev to commit directly to master. Forbidden for core.') @click.pass_context -def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude): +def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude, allow_master): """Perform a set of operations needed to release checks: \b @@ -52,10 +53,6 @@ def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude): if check not in valid_checks: abort(f'Check `{check}` is not an Agent-based Integration') - # don't run the task on the master branch - if get_current_branch() == 'master': - abort('Please create a release branch, you do not want to commit to master directly.') - if releasing_all: if version: abort('You cannot bump every check to the same version') @@ -74,6 +71,9 @@ def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude): repo_choice = ctx.obj['repo_choice'] core_workflow = repo_choice == 'core' + if get_current_branch() == 'master' and (core_workflow or not allow_master): + abort('Please create a release branch, you do not want to commit to master directly.') + # Signing is done by a pipeline in a separate commit if not core_workflow and not sign_only: skip_sign = True