`changeset status` succeeds locally, fails in CI with a changeset file verifiably present
See original GitHub issueAffected Packages
cli
"version": "2.18.1",
Problem
I have a monorepo of related packages and yarn changeset status succeeds locally, but fails in CI (azure devops). There is definitely a changeset file present in the ADO workspace.
Before I try
yarn changeset status
I am testing using just
ls -la
to make sure the files actually exist:

and in the .changeset folder:

So i KNOW the changeset file exists. I generated it with a standard
yarn changeset add
However, when I run
yarn changeset status
right after those ls commands, i get:

I’ve also tried
yarn changeset status --since="origin/main"
since main is my baseBranch. When i run that, the error is different:

Here is my config.json:
{
"$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": true,
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "minor",
"ignore": ["@<scope>/docs", "@<scope>/playroom", "@<scope>/private-playroom"]
}
This CI job is running ON a merge of the main branch. So the --since= I would think isnt necessary, but i can’t run the status command without origin/main because for some reason changesets cant find the main branch?
Any idea what is happening here? I do want to check for changesets, even an empty one in my CI at least for the time being until we get used to our deployment cadences and figure out better how and when we need changesets.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
My bet is that you are using some kind of shallow cloning there, on the CI, and
changeset statuscan’t access the base branch. A quick solution that could be done on your side would be to fetch it before you callchangeset status. Other than that you could help me out to figure out what’s the best solution here - what Changesets behavior should be? What do you think should happen? If the branch is missing locally should we try to get its hash from the remote and fetch the git history between that and the current HEAD?I actually have a question that might be relevant here. BTW thanks a TON for your help!
The way my flow is gonna work is that changesets are going to be created in PRs (there is a
changeset statusin the PR build also, that seems to work), then when that PR is merged intomainanother build runs that does mostly the same stuff but has some publishing steps.This build that i’m referring to is the build for
mainso its building a detached HEAD of main from themainbranch itself. Ischangeset statusalways making sure that the head is detached from the base branch and has different commits? If i’m buildingmainand my--sinceis alsomainthen there wont be a detach commit point because the commit history of the branch i’m building would be the same as the--since?If so, should i just NOT check for changesets in the
mainmerge build since i’m checking for them in PR builds and PR branches will have a detach point that is different frommain?