diff --git a/ci-includes/src/createGitlabBaseInclude.ts b/ci-includes/src/createGitlabBaseInclude.ts index c1e55417c802c2f7a135cf6c7b956bc8a2b49e3c..4f2586e568a3c4b6793418d51a001ff0d0cccf56 100644 --- a/ci-includes/src/createGitlabBaseInclude.ts +++ b/ci-includes/src/createGitlabBaseInclude.ts @@ -6,9 +6,7 @@ import { RULES_ALWAYS, getRunnerImage, RULES_RELEASE, - RULE_NEVER_ON_RELEASE_COMMIT, - RULE_CONDITION_MAIN_BRANCH, - RULE_CONDITION_HOTFIX_BRANCH, + RULES_MANUAL_RELEASE, } from "@catladder/pipeline"; type GitlabJobDefWithTrigger = Omit<GitlabJobDef, "script"> & { @@ -72,17 +70,7 @@ export const createGitlabBaseInclude = () => { image: getRunnerImage("semantic-release"), script: ["semanticRelease"], needs: [], - rules: [ - RULE_NEVER_ON_RELEASE_COMMIT, - { - if: RULE_CONDITION_MAIN_BRANCH, - when: "manual", - }, - { - if: RULE_CONDITION_HOTFIX_BRANCH, - when: "manual", - }, - ], + rules: RULES_MANUAL_RELEASE, }, }; return { diff --git a/pipeline/src/rules/index.ts b/pipeline/src/rules/index.ts index 0379979063be527b5d5691e64cec6a44cbb46fec..71069c116efd236cdd0112cbd55155128744e002 100644 --- a/pipeline/src/rules/index.ts +++ b/pipeline/src/rules/index.ts @@ -41,3 +41,15 @@ export const RULES_RELEASE: GitlabRule[] = [ when: "manual", }, ]; + +export const RULES_MANUAL_RELEASE: GitlabRule[] = [ + RULE_NEVER_ON_RELEASE_COMMIT, + { + if: RULE_CONDITION_MAIN_BRANCH, + when: "manual", + }, + { + if: RULE_CONDITION_HOTFIX_BRANCH, + when: "manual", + }, +];