Skip to content

Commit 759af2f

Browse files
built custom sync logic in the release script
1 parent b2f5797 commit 759af2f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

scripts/release-make-it-native.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,23 @@ function injectUnreleasedToDoc(docPath, unreleasedContent) {
121121
return `${frontmatter}\n\n${firstParagraph}\n${title}\n\n${unreleasedContent}\n\n${afterFirstParagraph}`;
122122
}
123123

124+
async function syncForkWithUpstream() {
125+
// Sync the fork's development branch with upstream (mendix/docs) via the GitHub API.
126+
// This is equivalent to clicking "Sync fork" on GitHub and ensures the fork
127+
// doesn't have extra commits (e.g., from sync.yml merge commits) that would
128+
// appear in the PR diff.
129+
console.log("Syncing MendixMobile/docs fork with upstream mendix/docs...");
130+
const result = await octokit.request(
131+
"POST /repos/{owner}/{repo}/merge-upstream",
132+
{
133+
owner: DOCS_REPO_OWNER,
134+
repo: DOCS_REPO_NAME,
135+
branch: "development",
136+
}
137+
);
138+
console.log(`✅ Fork synced: ${result.data.message} (${result.data.merge_type})`);
139+
}
140+
124141
async function cloneDocsRepo() {
125142
const git = simpleGit();
126143

@@ -182,6 +199,7 @@ async function updateMiNChangelog(changelog, unreleasedContent, changelogPath) {
182199
// Update MiN Release Notes in Docs repo
183200
async function updateMiNReleaseNotes(unreleasedContent) {
184201
try {
202+
await syncForkWithUpstream();
185203
await cloneDocsRepo();
186204
const git = simpleGit();
187205
await checkoutLocalBranch(git);

0 commit comments

Comments
 (0)