Skip to content

Commit 9aa4582

Browse files
committed
feat: add restrict release on version branch
1 parent 1cd9130 commit 9aa4582

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/package/release.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ export default class Publish {
7171
return result( [ 500, "Release on tbe detached head is not possible" ] );
7272
}
7373

74-
if ( !this.#pkg.cliConfig.release.branches.includes( status.head.branch ) ) {
75-
return result( [ 500, `Release on branch "${ status.head.branch }" is not allowed` ] );
74+
if ( this.#pkg.cliConfig.release.versionBranch && !SemanticVersion.isValid( status.head.branch ) ) {
75+
return result( [ 500, "Release on not version branch is not possible" ] );
7676
}
7777

7878
// check for uncommited changes

resources/cli.config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ meta:
5252

5353
release:
5454
enabled: false
55-
branches: [main]
55+
versionBranch: false
5656

5757
docker:
5858
composeFile: compose.yaml

resources/schemas/cli.config.schema.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ properties:
109109
type: object
110110
properties:
111111
enabled: { type: boolean }
112-
branches: { type: array, items: { type: string }, uniqueItems: true, minItems: 1 }
112+
versionBranch: { type: boolean }
113113
additionalProperties: false
114-
required: [enabled, branches]
114+
required: [enabled, versionBranch]
115115

116116
docker:
117117
type: object

0 commit comments

Comments
 (0)