-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
nx affected:apps fails with error fatal: Not a valid object name master #2170
Comments
Hi, do you have a If For Example:
|
I am running this on CI and yes I do have a branch called master, but surprising this is that it worked with earlier version, but not after updating to latest. |
I have the same problem on CI using Github Actions and it only happens when running on a branch other than master. When running on the master it works without problems. |
@DedoxBR I resolved this by replacing above command with |
@whimzyLive it didn't work for me. If it helps, I created a clean repository simulating the problem here: |
Is there anything new? Having the same problem. Having a default branch "develop" and trying to test and build affected with GitHub Actions, but no matter what i set as base head or anything else helps. |
I run affected:build like this:
where NX_BASE is different depending on whether a push event or a pull request triggers the workflow. In case of a push, we want to look at the commit id of the second newest commit, which translates to Keep in mind that you need to use the checkout action earlier with a fetch depth of at least 2 for this to work. In case of a pull request, it could look like something like this This is the newest commit id of the target branch. I needed to use git fetch origin beforehand for this to work. Hope this helps a bit! |
are you sure you aren't forgetting the double dash? WORKS DOESN'T WORK |
I had to use |
So I encountered this issue in Github Actions and after some debugging I have found the following: By default Github Actions checkout action only pulls the latest commit in a detached head state. I have found this causes any git operation for comparison to break. I resolved the issue in Github Actions with these steps:
The key here is changing the default ref so that it pulls the branch instead of just the single commit.
To make this work I had to ensure I had I hope this can be of use to others experiencing this issue Also link to github checkout action thread regarding this use case: actions/checkout#155 |
@Plysepter thanks for the suggestion, however, I am still having issues. This is my config:
And I get the error Does anything stick out to you that I might be doing wrong? |
@devinshoemaker this extra '--' is required to escape args. Have a look at this also please close the issue this works for you. |
@whimzyLive thanks for the suggestion. That's no longer needed for Yarn while it still is for NPM. I gave it a try anyway and still got the same result, but with the added warning of
|
@devinshoemaker you may want to replace your Github Actions checkout action only pulls the latest commit in a detached head state by default and only pulls in the most recent commit. You have to configure |
@Plysepter ah, thank you! That definitely helped. Here's my current best working config:
I think this issue can be closed now. |
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
This should fix issue with NX CLI (see nrwl/nx#2170)
While our team was trying to migrate to Nx, we found out this issue: nrwl#2170 The documentation doesn't mention about this behaviour but in our case setting the --base to origin/{current_branch} fixed it. I've set the env variable accordingly in the md file.
While our team was trying to migrate to Nx, we found out this issue: nrwl#2170 The documentation doesn't mention about this behaviour but in our case setting the --base to origin/{current_branch} fixed it. I've set the env variable accordingly in the md file.
While our team was trying to migrate to Nx, we found out this issue: nrwl#2170 The documentation doesn't mention about this behaviour but in our case setting the --base to origin/{current_branch} fixed it. I've set the env variable accordingly in the md file.
Tnx. works for me, |
same situation, nothing works |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.
Expected Behavior
nx affected:apps --plain
should display list of affected apps.we use this comma separated list of affected apps to determine what apps to deploy
What is the current behavior?
No
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
Please provide any relevant information about your setup:
A minimal reproduction scenario allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.
Failure Logs
Please include any relevant log snippets or files here.
Above command fails with
The text was updated successfully, but these errors were encountered: