@bakers-build/addon-forge 0.8.1-next.6 → 0.8.1-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/rules.d.ts +5 -1
- package/dist/src/rules.js +7 -2
- package/dist/src/tool-definitions.js +1 -1
- package/dist/src/tools.js +2 -1
- package/package.json +4 -4
package/dist/src/rules.d.ts
CHANGED
|
@@ -5,10 +5,14 @@ export declare const TITLE_REFUSAL = "the title must be a Conventional Commits s
|
|
|
5
5
|
/** The run's own branch, or `<branch_name>-<suffix>`. */
|
|
6
6
|
export declare function isOwned(branch: string, branchName: string): boolean;
|
|
7
7
|
export declare function ownershipRefusal(branch: string, branchName: string): string;
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The ticket branch merges into `target_branch` (a deployment's environment
|
|
10
|
+
* branch), else `base_branch`; a variant into the ticket branch.
|
|
11
|
+
*/
|
|
9
12
|
export declare function derivedBase(branch: string, run: {
|
|
10
13
|
branchName: string;
|
|
11
14
|
baseBranch: string;
|
|
15
|
+
targetBranch?: string;
|
|
12
16
|
}): string;
|
|
13
17
|
/** Remove every secret and any Authorization header value. */
|
|
14
18
|
export declare function redact(text: string, secrets: readonly string[]): string;
|
package/dist/src/rules.js
CHANGED
|
@@ -24,9 +24,14 @@ export function isOwned(branch, branchName) {
|
|
|
24
24
|
export function ownershipRefusal(branch, branchName) {
|
|
25
25
|
return `branch '${branch}' is not owned by this run: only '${branchName}' and '${branchName}-<suffix>' may be used`;
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The ticket branch merges into `target_branch` (a deployment's environment
|
|
29
|
+
* branch), else `base_branch`; a variant into the ticket branch.
|
|
30
|
+
*/
|
|
28
31
|
export function derivedBase(branch, run) {
|
|
29
|
-
return branch === run.branchName
|
|
32
|
+
return branch === run.branchName
|
|
33
|
+
? (run.targetBranch ?? run.baseBranch)
|
|
34
|
+
: run.branchName;
|
|
30
35
|
}
|
|
31
36
|
/** Remove every secret and any Authorization header value. */
|
|
32
37
|
export function redact(text, secrets) {
|
|
@@ -30,7 +30,7 @@ export const FORGE_TOOL_DEFINITIONS = {
|
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
forge_pr_upsert: {
|
|
33
|
-
description: "Create the PR/MR of an owned branch into its base (
|
|
33
|
+
description: "Create the PR/MR of an owned branch into its base (target_branch, which is base_branch unless a deployment names its environment branch; the ticket branch for a variant), or update the open one's title and body. The title must be a Conventional Commits subject.",
|
|
34
34
|
input: {
|
|
35
35
|
type: 'object',
|
|
36
36
|
properties: {
|
package/dist/src/tools.js
CHANGED
|
@@ -14,6 +14,7 @@ function runOf(req) {
|
|
|
14
14
|
identifier: t.identifier,
|
|
15
15
|
branchName: t.branchName,
|
|
16
16
|
baseBranch: t.baseBranch,
|
|
17
|
+
...(t.targetBranch ? { targetBranch: t.targetBranch } : {}),
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
function ownedBranch(req, run) {
|
|
@@ -104,7 +105,7 @@ export function forgeTools(deps) {
|
|
|
104
105
|
const run = runOf(req);
|
|
105
106
|
const b = await backend();
|
|
106
107
|
let ref;
|
|
107
|
-
let base = run.baseBranch;
|
|
108
|
+
let base = run.targetBranch ?? run.baseBranch;
|
|
108
109
|
if (typeof req.args.ref === 'string' && req.args.branch === undefined) {
|
|
109
110
|
ref = req.args.ref;
|
|
110
111
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/addon-forge",
|
|
3
|
-
"version": "0.8.1-next.
|
|
3
|
+
"version": "0.8.1-next.8",
|
|
4
4
|
"description": "bakers.build forge tools: a sandboxed run fetches, pushes its own branches, opens its PR/MR, reads checks and merges through the conductor, which holds the token. Backends implement the ForgeBackend contract (./backend).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"directory": "bakers-cli/addons/forge"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@bakers-build/conductor": "^0.8.1-next.
|
|
26
|
-
"@bakers-build/core": "^0.8.1-next.
|
|
25
|
+
"@bakers-build/conductor": "^0.8.1-next.8",
|
|
26
|
+
"@bakers-build/core": "^0.8.1-next.8"
|
|
27
27
|
},
|
|
28
28
|
"bakersBuild": {
|
|
29
|
-
"commit": "
|
|
29
|
+
"commit": "ae5f48bb09d2b0b375637301884a449dad989567",
|
|
30
30
|
"channel": "next"
|
|
31
31
|
}
|
|
32
32
|
}
|