Gh-pages deployment authentication failure using yarn

After some months away from my projects, I’ve transferred over some of my personal GitHub repos to an organization account, given the recent changes to pricing (i.e., free). I’m trying to set Travis CI back up, but I’m running into issues with authentication at the deployment stage. The project passes all tests, builds successfully, and then when trying to deploy it errors with remote: Invalid username or password.

I’ve double-checked that my personal access token has the correct permissions (repo access), I’ve regenerated the access token and re-added it in my Travis CI settings as an environment variable, I’ve tried renaming the variable, using all lowercase or all uppercase, I’ve tried referencing the variable both in quotes and without quotes, I’ve tried updating my .travis.yml file to use dpl v2, but I just can’t seem to get it to authenticate.

Is there something I’m missing? Do the access token permissions need to be different when using a gh organization than when I’m using a personal repo? Is there some other configuration or setup mistake or step I’m missing?

Thanks in advance!

Thanks for your response, @native-api!

I set the token as a variable within the Travis CI repository settings and then referenced it within the .travis.yml file, rather than encrypting it and adding it to my .travis.yml file directly.

Do I still need to use the Travis CLI to encrypt the token before adding it to the repo settings? The documentation doesn’t say either way (it’s a little vague in this regard), but it talks about the secrets added there being stored encrypted and then decrypted when pulled in for the build, which suggests to me that manually encrypting the token is unneeded. Am I wrong about that?

From what I can see, your build does not reach the deploy: phase.

Instead, yarn build tries to do the deployment itself, invoking some 3rd-party tool for that.

So either

  • make it not do that, or
  • refer to that tool’s documentation on how you are supposed to authenticate with it and stuff, and delete the deploy: clause as redundant
1 Like

:man_facepalming: That was it! I knew it had to be something simple and dumb. Now that I’ve removed the postbuild deployment script in the package.json file, it worked perfectly. Thank you so much!

On a side note, is there a way to mark a response as the solution, like in that other thread you linked to? I can’t seem to find that functionality here.

You cannot, in this paricular category :neutral_face:
I created a feature request long ago to enable marking as solved everywhere, it was ignored so far.

Gotcha, thanks. Well, if it helps, I’ve just voted for it! :slight_smile: