Skip to content

Commit b51d31f

Browse files
Add sync logic and updates in release MiN script
1 parent 8d7da33 commit b51d31f

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/release-make-it-native.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
with:
2222
node-version-file: .nvmrc
2323

24+
- name: Sync docs fork with upstream
25+
run: gh repo sync MendixMobile/docs --branch development --force
26+
env:
27+
GH_TOKEN: ${{ secrets.PAT }}
28+
2429
- name: Install dependencies
2530
run: npm ci
2631

scripts/release-make-it-native.mjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ async function createPRUpdateChangelog() {
7979

8080
await git.addConfig("user.name", GIT_AUTHOR_NAME, ["--global"]);
8181
await git.addConfig("user.email", GIT_AUTHOR_EMAIL, ["--global"]);
82+
83+
// Get the current branch name (the one selected in GitHub Actions UI)
84+
const currentBranch = await git.revparse(["--abbrev-ref", "HEAD"]);
8285

8386
await git.checkoutLocalBranch(CHANGELOG_BRANCH_NAME);
8487

@@ -91,7 +94,7 @@ async function createPRUpdateChangelog() {
9194
repo: process.env.GITHUB_REPOSITORY.split("/")[1],
9295
title: `Update CHANGELOG for v${MIN_VERSION}`,
9396
head: CHANGELOG_BRANCH_NAME,
94-
base: "main",
97+
base: currentBranch,
9598
body: "**Note:** Please do not take any action on this pull request unless it has been reviewed and approved by a member of the Mobile team.",
9699
draft: true,
97100
});
@@ -121,9 +124,6 @@ function injectUnreleasedToDoc(docPath, unreleasedContent) {
121124
return `${frontmatter}\n\n${firstParagraph}\n${title}\n\n${unreleasedContent}\n\n${afterFirstParagraph}`;
122125
}
123126

124-
// This file exists only in the fork (MendixMobile/docs) and not in upstream (mendix/docs).
125-
// Removing it in our branch ensures it doesn't appear in the cross-fork PR diff.
126-
const FORK_SYNC_FILE = ".github/workflows/sync.yml";
127127

128128
async function cloneDocsRepo() {
129129
const git = simpleGit();
@@ -148,10 +148,6 @@ async function updateDocsMiNReleaseNotes(unreleasedContent) {
148148
}
149149

150150
async function createPRUpdateDocsMiNReleaseNotes(git) {
151-
// Remove the fork's sync.yml so it doesn't appear in the cross-fork PR diff.
152-
if (fs.existsSync(FORK_SYNC_FILE)) {
153-
await git.rm(FORK_SYNC_FILE);
154-
}
155151
await git.add(TARGET_FILE);
156152
await git.commit(`docs: update mobile release notes for v${MIN_VERSION}`);
157153
await git.push("origin", DOCS_BRANCH_NAME, ["--force"]);

0 commit comments

Comments
 (0)