File tree Expand file tree Collapse file tree 5 files changed +60
-5
lines changed
Expand file tree Collapse file tree 5 files changed +60
-5
lines changed Original file line number Diff line number Diff line change 1818use SebastianFeldmann \Git \Repository ;
1919
2020/**
21- * NotOn condition
21+ * NotOn Branch condition
22+ *
23+ * Example configuration:
24+ * <code>
25+ * {
26+ * "action": "some-action",
27+ * "conditions": [
28+ * {
29+ * "exec": "CaptainHook.Status.NotOnBranch",
30+ * "args": ["not-on-this-branch"]
31+ * }
32+ * ]
33+ * }
34+ * </code>
2235 *
2336 * @package CaptainHook
2437 * @author Sebastian Feldmann <sf@sebastian-feldmann.info>
Original file line number Diff line number Diff line change 1818use SebastianFeldmann \Git \Repository ;
1919
2020/**
21- * NotOnMatching condition
21+ * NotOnMatching Branch condition
22+ *
23+ * Example configuration:
24+ * <code>
25+ * {
26+ * "action": "some-action",
27+ * "conditions": [
28+ * {
29+ * "exec": "CaptainHook.Status.NotOnMatchingBranch",
30+ * "args": ["#^branches-names/not-matching[0-9]+-this-regex$#i"]
31+ * }
32+ * ]
33+ * }
34+ * </code>
2235 *
2336 * @package CaptainHook
2437 * @author Sebastian Feldmann <sf@sebastian-feldmann.info>
Original file line number Diff line number Diff line change 1818use SebastianFeldmann \Git \Repository ;
1919
2020/**
21- * On condition
21+ * On Branch condition
22+ *
23+ * Example configuration:
24+ * <code>
25+ * {
26+ * "action": "some-action",
27+ * "conditions": [
28+ * {
29+ * "exec": "CaptainHook.Status.OnBranch",
30+ * "args": ["only-on-this-branch"]
31+ * }
32+ * ]
33+ * }
34+ * </code>
2235 *
2336 * @package CaptainHook
2437 * @author Sebastian Feldmann <sf@sebastian-feldmann.info>
Original file line number Diff line number Diff line change 1818use SebastianFeldmann \Git \Repository ;
1919
2020/**
21- * OnMatching condition
21+ * OnMatching Branch condition
22+ *
23+ * Example configuration:
24+ * <code>
25+ * {
26+ * "action": "some-action",
27+ * "conditions": [
28+ * {
29+ * "exec": "CaptainHook.Status.OnMatchingBranch",
30+ * "args": ["#^branches-names/matching[0-9]+-this-regex$#i"]
31+ * }
32+ * ]
33+ * }
34+ * </code>
2235 *
2336 * @package CaptainHook
2437 * @author Sebastian Feldmann <sf@sebastian-feldmann.info>
Original file line number Diff line number Diff line change @@ -75,7 +75,10 @@ class Shorthand
7575 'thatis ' => Hook \Condition \FileStaged \ThatIs::class,
7676 ],
7777 'status ' => [
78- 'onbranch ' => Hook \Condition \Branch \On::class,
78+ 'onbranch ' => Hook \Condition \Branch \On::class,
79+ 'onmatchingbranch ' => Hook \Condition \Branch \OnMatching::class,
80+ 'notonbranch ' => Hook \Condition \Branch \NotOn::class,
81+ 'notonmatchingbranch ' => Hook \Condition \Branch \NotOnMatching::class,
7982 ]
8083 ]
8184 ];
You can’t perform that action at this time.
0 commit comments