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

Publishing fails due to GITHUB_TOKEN not being found #503

Closed
3 tasks done
benjtinsley opened this issue May 2, 2018 · 3 comments
Closed
3 tasks done

Publishing fails due to GITHUB_TOKEN not being found #503

benjtinsley opened this issue May 2, 2018 · 3 comments

Comments

@benjtinsley
Copy link

benjtinsley commented May 2, 2018

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

I need to publish my app to a private repo, however when running the publish task it fails with the following output:

$ electron-forge publish
✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: x64
✔ Compiling Application
✔ Preparing native dependencies
✔ Packaging Application
Making for the following targets:
✔ Making for target: zip - On platform: darwin - For arch: x64
✔ Making for target: dmg - On platform: darwin - For arch: x64
✔ Resolving publish target: github

Electron forge was terminated:
Please set GITHUB_TOKEN in your environment to access these features

However, I have a GITHUB_TOKEN variable set in my .env file like so:

//.env
export GITHUB_TOKEN=[my github token]

Should I be setting it elsewhere? The documentation does not mention where to put a github token in the event of a private repo so perhaps I am setting it in the wrong place.

Thanks!

@benjtinsley
Copy link
Author

It appears I would have to set the token in the command with the --auth-token flag. Perhaps the error message could be improved a bit, but for now I think this gets me to where I need to go.

@MarshallOfSound
Copy link
Member

.env files are not automatically read, I'd you have that variable actually set in your she'll it should work fine

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
Co-authored-by: malept <electron-bot@users.noreply.github.com>
@luveqz
Copy link

luveqz commented Jan 20, 2024

The env-cmd package works for me:

package.json

{
  "scripts": {
    "publish": "env-cmd electron-forge publish",
  }
}

.env

GITHUB_TOKEN=my-token-foo-bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants