fix: final fix of beta workflow (#6713)

This commit is contained in:
Louis Lam
2026-01-14 10:28:34 +08:00
committed by GitHub
parent 2f82ff3787
commit b2d7031522
3 changed files with 13 additions and 4 deletions

View File

@@ -50,7 +50,8 @@ jobs:
git push origin --delete "release-${VERSION}" || true git push origin --delete "release-${VERSION}" || true
# Delete local branch if it exists # Delete local branch if it exists
git branch -D "release-${VERSION}" || true git branch -D "release-${VERSION}" || true
# Create new branch from master # For testing purpose
# git checkout beta-workflow
git checkout -b "release-${VERSION}" git checkout -b "release-${VERSION}"
- name: Install dependencies - name: Install dependencies

View File

@@ -1,3 +1,6 @@
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const pkg = require("../../package.json"); const pkg = require("../../package.json");
const fs = require("fs"); const fs = require("fs");
const childProcess = require("child_process"); const childProcess = require("child_process");
@@ -58,8 +61,13 @@ function commit(version) {
throw new Error("commit error"); throw new Error("commit error");
} }
// Note: Push is handled by gh pr create in the release script // Get the current branch name
// No need to push here as we're on a release branch, not master res = childProcess.spawnSync("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
let branchName = res.stdout.toString().trim();
console.log("Current branch:", branchName);
// Git push the branch
childProcess.spawnSync("git", ["push", "origin", branchName, "--force"], { stdio: "inherit" });
} }
/** /**

View File

@@ -48,7 +48,7 @@ checkDocker();
await checkTagExists(repoNames, version); await checkTagExists(repoNames, version);
// node extra/beta/update-version.js // node extra/beta/update-version.js
execSync("node ./extra/beta/update-version.js"); await import("../beta/update-version.mjs");
// Create Pull Request (gh pr create will handle pushing the branch) // Create Pull Request (gh pr create will handle pushing the branch)
await createReleasePR(version, previousVersion, dryRun, branchName, githubRunId); await createReleasePR(version, previousVersion, dryRun, branchName, githubRunId);