@ucdjs/release-scripts 0.1.0-beta.13 → 0.1.0-beta.14
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 +7 -7
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1165,7 +1165,7 @@ async function release(options) {
|
|
|
1165
1165
|
});
|
|
1166
1166
|
await prOps.prepareBranch();
|
|
1167
1167
|
await applyUpdates();
|
|
1168
|
-
if (!await prOps.
|
|
1168
|
+
if (!await prOps.syncChanges(true)) if (prOps.doesReleasePRExist && prOps.existingPullRequest) {
|
|
1169
1169
|
logger.item("No updates needed, PR is already up to date");
|
|
1170
1170
|
return {
|
|
1171
1171
|
updates: allUpdates,
|
|
@@ -1176,8 +1176,8 @@ async function release(options) {
|
|
|
1176
1176
|
logger.error("No changes to commit, and no existing PR. Nothing to do.");
|
|
1177
1177
|
return null;
|
|
1178
1178
|
}
|
|
1179
|
-
const { pullRequest, created } = await prOps.
|
|
1180
|
-
await prOps.
|
|
1179
|
+
const { pullRequest, created } = await prOps.syncPullRequest(allUpdates);
|
|
1180
|
+
await prOps.cleanup();
|
|
1181
1181
|
if (pullRequest?.html_url) {
|
|
1182
1182
|
logger.section("🚀 Pull Request");
|
|
1183
1183
|
logger.success(`Pull request ${created ? "created" : "updated"}: ${pullRequest.html_url}`);
|
|
@@ -1228,7 +1228,7 @@ async function orchestrateReleasePullRequest({ workspaceRoot, owner, repo, githu
|
|
|
1228
1228
|
return {
|
|
1229
1229
|
existingPullRequest,
|
|
1230
1230
|
doesReleasePRExist,
|
|
1231
|
-
|
|
1231
|
+
async prepareBranch() {
|
|
1232
1232
|
if (!branchExists) await createBranch(releaseBranch, defaultBranch, workspaceRoot);
|
|
1233
1233
|
logger.step(`Checking out release branch: ${releaseBranch}`);
|
|
1234
1234
|
if (!await checkoutBranch(releaseBranch, workspaceRoot)) throw new Error(`Failed to checkout branch: ${releaseBranch}`);
|
|
@@ -1239,7 +1239,7 @@ async function orchestrateReleasePullRequest({ workspaceRoot, owner, repo, githu
|
|
|
1239
1239
|
logger.step(`Rebasing onto ${defaultBranch}`);
|
|
1240
1240
|
if (!await rebaseBranch(defaultBranch, workspaceRoot)) throw new Error(`Failed to rebase onto ${defaultBranch}. Please resolve conflicts manually.`);
|
|
1241
1241
|
},
|
|
1242
|
-
|
|
1242
|
+
async syncChanges(hasChanges) {
|
|
1243
1243
|
const hasCommitted = hasChanges ? await commitChanges("chore: update release versions", workspaceRoot) : false;
|
|
1244
1244
|
const isBranchAhead = await isBranchAheadOfRemote(releaseBranch, workspaceRoot);
|
|
1245
1245
|
if (!hasCommitted && !isBranchAhead) {
|
|
@@ -1251,7 +1251,7 @@ async function orchestrateReleasePullRequest({ workspaceRoot, owner, repo, githu
|
|
|
1251
1251
|
if (!await pushBranch(releaseBranch, workspaceRoot, { forceWithLease: true })) throw new Error(`Failed to push changes to ${releaseBranch}. Remote may have been updated.`);
|
|
1252
1252
|
return true;
|
|
1253
1253
|
},
|
|
1254
|
-
|
|
1254
|
+
async syncPullRequest(updates) {
|
|
1255
1255
|
const prTitle = existingPullRequest?.title || pullRequestTitle || "chore: update package versions";
|
|
1256
1256
|
const prBody = pullRequestBody || generatePullRequestBody(updates);
|
|
1257
1257
|
const pullRequest = await upsertPullRequest({
|
|
@@ -1270,7 +1270,7 @@ async function orchestrateReleasePullRequest({ workspaceRoot, owner, repo, githu
|
|
|
1270
1270
|
created: !doesReleasePRExist
|
|
1271
1271
|
};
|
|
1272
1272
|
},
|
|
1273
|
-
|
|
1273
|
+
async cleanup() {
|
|
1274
1274
|
await checkoutBranch(defaultBranch, workspaceRoot);
|
|
1275
1275
|
}
|
|
1276
1276
|
};
|