Skip to content

Commit

Permalink
fix fork
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Dec 19, 2024
1 parent 9058250 commit c83187d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
/repos/mayank1513/turborepo-template/merge-upstream \
-f "branch=main"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.mayank1513PAT }}
7 changes: 4 additions & 3 deletions scripts/publish.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/** It is assumed that this is called only from the default branch. */
const { execSync } = require("child_process");

const BRANCH = process.env.BRANCH;

// Apply changesets if any -- e.g., coming from pre-release branches
try {
execSync("pnpm changeset pre exit");
Expand All @@ -10,7 +12,7 @@ try {
try {
execSync("pnpm changeset version");
execSync(
`git add . && git commit -m "Apply changesets and update CHANGELOG" && git push origin ${process.env.BRANCH}`,
`git add . && git commit -m "Apply changesets and update CHANGELOG" && git push origin ${BRANCH}`,
);
} catch {
// no changesets to be applied
Expand All @@ -32,12 +34,11 @@ const [oldMajor, oldMinor] = LATEST_VERSION.split(".");

const isPatch = newMajor === oldMajor && newMinor === oldMinor;
const releaseBranch = `release-${newMajor}.${newMinor}`;
const DEFAULT_BRANCH = process.env.DEFAULT_BRANCH;

if (isPatch) {
// update release branch
execSync(
`git checkout ${releaseBranch} && git merge ${DEFAULT_BRANCH} && git push origin ${releaseBranch}`,
`git checkout ${releaseBranch} && git merge ${BRANCH} && git push origin ${releaseBranch}`,
);
} else {
require("./update-security-md")(`${newMajor}.${newMinor}`, `${oldMajor}.${oldMinor}`);
Expand Down

0 comments on commit c83187d

Please sign in to comment.