-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node 18 "Failed to find where HEAD diverged from origin/master" #1055
Comments
I've got the same issue when trying to publish from the turborepo design system repo https://vercel.com/templates/react/turborepo-design-system
but simply renaming the branch to master worked for me |
@ivanbanov can you check what @williamlmao most likely you can fix this by using this value in your {
"baseBranch": "main"
} |
@Andarist I just got the logs
Note, it works properly on my Mac with Node18 |
I thought I should also add my changeset config here, just in case
{
"$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "origin/master",
"ignore": [],
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"updateInternalDependents": "always"
},
"snapshot": { "useCalculatedVersion": true }
} |
@williamlmao where are you changing your branch to master. I've cloned turbo-repo-designsystem and am having the same issue. |
Locally this ran fine for me. In a gitlab pipeline, this was failing to run. Changing baseBranch to "origin/main" resolved my issue (previously it was "main"). |
This is failing for me in CI where I check if a PR has a changeset in it. I've tried pretty much all the solutions provided in this issue, like changing the
name: Pull Request CI
on:
pull_request:
branches:
- main
jobs:
pr-check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
- name: Check if PR has Changeset
run: pnpm changeset status
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"baseBranch": "main",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": { "version": true, "tag": true }
} Error/Call Stack (some directories replaced by 🦋 error Error: Failed to find where HEAD diverged from main. Does main exist?
🦋 error at getDivergedCommit (/home/runner/work/<other-folders>/node_modules/.pnpm/@changesets+git@2.0.0/node_modules/@changesets/git/dist/git.cjs.dev.js:66:11)
🦋 error at async getChangedFilesSince (/home/runner/work/<other-folders>/node_modules/.pnpm/@changesets+git@2.0.0/node_modules/@changesets/git/dist/git.cjs.dev.js:198:22)
🦋 error at async Object.getChangedPackagesSinceRef (/home/runner/work/<other-folders>/node_modules/.pnpm/@changesets+git@2.0.0/node_modules/@changesets/git/dist/git.cjs.dev.js:239:24)
🦋 error at async getStatus (/home/runner/work/<other-folders>/node_modules/.pnpm/@changesets+cli@2.26.0/node_modules/@changesets/cli/dist/cli.cjs.dev.js:1170:27)
🦋 error at async run$2 (/home/runner/work/<other-folders>/node_modules/.pnpm/@changesets+cli@2.26.0/node_modules/@changesets/cli/dist/cli.cjs.dev.js:1446:11)
Error: Process completed with exit code 1. |
Thankfully i don't need to run this in a node 18 environment, but other steps of my code do. So setting my builder for |
This makes much more sense than the default config. You can't always assume local branches are up to date. |
Checkout with In your steps:
- uses: actions/checkout@v3
with:
# check out full history
fetch-depth: 0
# set baseBranch to origin/main
- run: pnpm changeset status --since origin/main |
In case the options above don't help you, try to use the last published tag:
|
I'm getting the same error message when I introduce changes during build job, for example I have overrides that I copy to the main folder during job execution, basically those are uncommitted changes. If I do that locally and commit and push changes to the branch, issue is gone. |
BTW, job is running on node 16.13.1 |
We use changeset on CI to check the bump plan. It was working as expected on Node 14.
After upgrading to Node 18 the script fails with the following error
While debugging it seems like everything is working as expected from the git side, but somehow the status fails internally
The logs from the debug
Im scratching my head trying to figure out what could possibly be wrong, any clue?
The text was updated successfully, but these errors were encountered: