forge: publish command --auth-token flag not working

I am attempting to publish to a private github repo. I either get a 404:

Electron forge was terminated:
{"code":404,"status":"Not Found","message":"{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3\"}"}

Or, if providing --auth-token in the command line, I get a 401:

Electron forge was terminated:
{"code":401,"status":"Unauthorized","message":"{\"message\":\"Bad credentials\",\"documentation_url\":\"https://developer.github.com/v3\"}"}

My forge config looks like this:

{
        "forge": {
            "make_targets": {
                "win32": [
                    "squirrel"
                ],
                "darwin": [
                    "dmg"
                ],
                "linux": [
                    "deb",
                    "rpm"
                ]
            },
            "electronPackagerConfig": {
                "icon": "./src/assets/favicon",
                "ignore": [
                    ".idea/"
                ]
            },
            "electronWinstallerConfig": {
                "name": "blahblah_repo"
            },
            "electronInstallerDebian": {},
            "electronInstallerRedhat": {},
            "github_repository": {
                "owner": "blahblah_owner",
                "name": "blahblah_repo"
            }
        }
    },

For the auth token value, I provide a personal access token for the repo, is that correct or is it something else? If it’s correct, what else am I doing wrong?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@guizmaii I think you may have had a different issue there. Maybe you figured it out but since I ran into this too I thought I’d mention the solution for anyone finding this later. Turns out that yarn publish is a command that tries to publish the package to npm. You could try yarn run publish instead to see if that works

On OSX/Linux, running GITHUB_TOKEN=whatever electron-forge publish will be sufficient.