Skip to content
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

ORGANIZATION_NAME and PROJECT_NAME didn't work as expected #374

Closed
aadsm opened this issue Jan 5, 2018 · 5 comments
Closed

ORGANIZATION_NAME and PROJECT_NAME didn't work as expected #374

aadsm opened this issue Jan 5, 2018 · 5 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.

Comments

@aadsm
Copy link
Contributor

aadsm commented Jan 5, 2018

I followed the guide on publishing to github and used GIT_USER=aadsm ORGANIZATION_NAME=aadsm PROJECT_NAME=draft-js CURRENT_BRANCH=docusaurus USE_SSH=true npm run publish-gh-pages to publish to my own fork of draft.js.

I was expecting the aadsm/draft-js#gh-pages branch to be updated but in reality facebook/draft-js#gh-pages was instead!
I haven't debug why, I'm assuming that at some point the configuration I have on siteConfig.js was used but I don't think this should have happened.

@JoelMarcey
Copy link
Contributor

Hi @aadsm. Yeah, if you have organizationName set in siteConfig.js set, that currently takes precedent. https://github.com/facebook/Docusaurus/blob/master/lib/publish-gh-pages.js#L23

const ORGANIZATION_NAME =
  siteConfig.organizationName ||
  process.env.ORGANIZATION_NAME ||
  process.env.CIRCLE_PROJECT_USERNAME;

We can discuss whether that should be the case. I can see the argument that manually set environment variables should take precedent, but at the time we thought that all siteConfig variables should be first in line.

But, we definitely don't want you publishing to an unexpected place - so we should figure something out that makes that not happen again.

@aadsm
Copy link
Contributor Author

aadsm commented Jan 5, 2018

Oh I see. I assumed that these would override any siteConfig options as that's usually what happens with these type of variables.
Take as an example git, if you set the GIT_AUTHOR_NAME environment variable then this will take precedent to the git configuration: https://git-scm.com/book/gr/v2/Git-Internals-Environment-Variables#_committing

@julen
Copy link

julen commented Jan 14, 2018

Just adding a note to mention I also hit this unexpected behavior. Same as @aadsm, I was expecting explicitly set environment variables to take precedence over any configuration set in siteConfig.js.

@JoelMarcey JoelMarcey added bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. labels Feb 27, 2018
@JoelMarcey
Copy link
Contributor

Seems reasonable that we should reverse the precedent. Anyone want to submit a PR here?

@juanpicado
Copy link
Contributor

Me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.
Projects
None yet
Development

No branches or pull requests

4 participants