mobbdev 0.0.69 → 0.0.71
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/index.mjs +6 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1330,12 +1330,14 @@ async function createPr({
|
|
|
1330
1330
|
repo: sourceRepo,
|
|
1331
1331
|
path: "/" + sourceFilePath
|
|
1332
1332
|
});
|
|
1333
|
+
const { data: repository } = await oktoKit.rest.repos.get({ owner, repo });
|
|
1334
|
+
const defaultBranch = repository.default_branch;
|
|
1333
1335
|
const newBranchName = `mobb/workflow-${Date.now()}`;
|
|
1334
1336
|
oktoKit.rest.git.createRef({
|
|
1335
1337
|
owner,
|
|
1336
1338
|
repo,
|
|
1337
1339
|
ref: `refs/heads/${newBranchName}`,
|
|
1338
|
-
sha: await oktoKit.rest.git.getRef({ owner, repo, ref:
|
|
1340
|
+
sha: await oktoKit.rest.git.getRef({ owner, repo, ref: `heads/${defaultBranch}` }).then((response) => response.data.object.sha)
|
|
1339
1341
|
});
|
|
1340
1342
|
const decodedContent = Buffer.from(
|
|
1341
1343
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1346,7 +1348,7 @@ async function createPr({
|
|
|
1346
1348
|
const createTreeResponse = await oktoKit.rest.git.createTree({
|
|
1347
1349
|
owner,
|
|
1348
1350
|
repo,
|
|
1349
|
-
base_tree: await oktoKit.rest.git.getRef({ owner, repo, ref: `heads
|
|
1351
|
+
base_tree: await oktoKit.rest.git.getRef({ owner, repo, ref: `heads/${defaultBranch}` }).then((response) => response.data.object.sha),
|
|
1350
1352
|
tree: [
|
|
1351
1353
|
{
|
|
1352
1354
|
path: targetFilePath,
|
|
@@ -1362,7 +1364,7 @@ async function createPr({
|
|
|
1362
1364
|
message: "Add new yaml file",
|
|
1363
1365
|
tree: createTreeResponse.data.sha,
|
|
1364
1366
|
parents: [
|
|
1365
|
-
await oktoKit.rest.git.getRef({ owner, repo, ref: `heads
|
|
1367
|
+
await oktoKit.rest.git.getRef({ owner, repo, ref: `heads/${defaultBranch}` }).then((response) => response.data.object.sha)
|
|
1366
1368
|
]
|
|
1367
1369
|
});
|
|
1368
1370
|
await oktoKit.rest.git.updateRef({
|
|
@@ -2640,7 +2642,7 @@ async function handleFinishedAnalysis({
|
|
|
2640
2642
|
});
|
|
2641
2643
|
const scanerString = scannerToFriendlyString(scanner);
|
|
2642
2644
|
const issueType = getIssueType(fix_by_pk.issueType);
|
|
2643
|
-
const title = `#  ${issueType} fix by Mobb is ready`;
|
|
2645
|
+
const title = `#  ${issueType} fix by Mobb is ready \u2705`;
|
|
2644
2646
|
const subTitle = `### Apply the following code change to fix ${issueType} issue detected by ${scanerString}:`;
|
|
2645
2647
|
const diff2 = `\`\`\`diff
|
|
2646
2648
|
${patch}
|