Skip to content

Commit 1bc9e41

Browse files
pipeline fixes
1 parent d7f7e73 commit 1bc9e41

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

scripts/release-make-it-native.mjs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,24 @@ async function cloneDocsRepo() {
135135

136136
await repoGit.addConfig("user.name", GIT_AUTHOR_NAME, false, "global");
137137
await repoGit.addConfig("user.email", GIT_AUTHOR_EMAIL, false, "global");
138+
}
138139

139-
// Add upstream remote and fetch so we can branch off the latest upstream/development.
140-
// This avoids including fork-only commits (e.g., sync.yml) in the PR.
141-
await repoGit.addRemote(
142-
"upstream",
143-
`https://x-access-token:${GITHUB_PAT}@github.com/${DOCS_UPSTREAM_OWNER}/${DOCS_REPO_NAME}.git`
144-
);
145-
await repoGit.fetch("upstream");
140+
async function getUpstreamDevelopmentSha() {
141+
// Use the GitHub API to get the latest commit SHA of mendix/docs:development.
142+
// This lets us branch from the exact upstream state without needing direct clone access,
143+
// avoiding fork-only commits (e.g., sync.yml) from appearing in the PR.
144+
const { data: branch } = await octokit.repos.getBranch({
145+
owner: DOCS_UPSTREAM_OWNER,
146+
repo: DOCS_REPO_NAME,
147+
branch: "development",
148+
});
149+
console.log(`Branching from upstream development SHA: ${branch.commit.sha}`);
150+
return branch.commit.sha;
146151
}
147152

148153
async function checkoutLocalBranch(git) {
149-
// Branch off upstream/development to ensure a clean PR with only our commit.
150-
await git.checkout(["-b", DOCS_BRANCH_NAME, "upstream/development"]);
154+
const upstreamSha = await getUpstreamDevelopmentSha();
155+
await git.checkout(["-b", DOCS_BRANCH_NAME, upstreamSha]);
151156
}
152157

153158
async function updateDocsMiNReleaseNotes(unreleasedContent) {

0 commit comments

Comments
 (0)