Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/release-make-it-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PAT: ${{ secrets.PAT }}
PAT: ${{ secrets.MENDIX_MOBILE_DOCS_PR_GITHUB_PAT }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4

Expand All @@ -21,14 +21,19 @@ jobs:
with:
node-version-file: .nvmrc

- name: Sync docs fork with upstream
run: gh repo sync MendixMobile/docs --branch development --force
env:
GH_TOKEN: ${{ secrets.MENDIX_MOBILE_DOCS_PR_GITHUB_PAT }}

- name: Install dependencies
run: npm ci

- name: Run release script
env:
MIN_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PAT: ${{ secrets.PAT }}
PAT: ${{ secrets.MENDIX_MOBILE_DOCS_PR_GITHUB_PAT }}
run: node scripts/release-make-it-native.mjs

- name: Send success message
Expand Down
12 changes: 4 additions & 8 deletions scripts/release-make-it-native.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ async function createPRUpdateChangelog() {

await git.addConfig("user.name", GIT_AUTHOR_NAME, ["--global"]);
await git.addConfig("user.email", GIT_AUTHOR_EMAIL, ["--global"]);

// Get the current branch name (the one selected in GitHub Actions UI)
const currentBranch = await git.revparse(["--abbrev-ref", "HEAD"]);

await git.checkoutLocalBranch(CHANGELOG_BRANCH_NAME);

Expand All @@ -91,7 +94,7 @@ async function createPRUpdateChangelog() {
repo: process.env.GITHUB_REPOSITORY.split("/")[1],
title: `Update CHANGELOG for v${MIN_VERSION}`,
head: CHANGELOG_BRANCH_NAME,
base: "main",
base: currentBranch,
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.",
draft: true,
});
Expand Down Expand Up @@ -121,9 +124,6 @@ function injectUnreleasedToDoc(docPath, unreleasedContent) {
return `${frontmatter}\n\n${firstParagraph}\n${title}\n\n${unreleasedContent}\n\n${afterFirstParagraph}`;
}

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

async function cloneDocsRepo() {
const git = simpleGit();
Expand All @@ -148,10 +148,6 @@ async function updateDocsMiNReleaseNotes(unreleasedContent) {
}

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