Why can't I connect my GitHub repo to Heroku? - heroku

We are unable to access this connected repository on GitHub
The authorization key is not valid, or the account used to connect to GitHub doesn't have access to the repository. Try disconnecting the repository above and then reconnect. That is the error I got when trying to connect my private GitHub repo to Heroku.
I've tried doing everything like making it public, or making a new repository, but it just won't work.
I don't have any code to show, since this is a Heroku problem, not a problem with the code.
I don't know what to do.

As on date 15 April 2022, there is security issue reported on github.
In action of the same, Heroku will not be reconnecting to GitHub till uncertain duration.
Action over the incident is reported on Heroku.
Courtesy: stackoverflow and salesforce stack-exchange

I have just had and fixed this issue hopefully I can help.
Are you setting up a new repository by any chance? What worked for me was to actually add some files the to the repository and push to GitHub, then Heroku was able to read from the repo then.
Hope this helps.

Related

Unauthorized access to push to my GitHub account from Sandbox or vagrant box .I only push through Gitbash

Please I'm working on a project that requires I must push my code to GitHub account through code sandbox or vagrant box. I can only push through Gitbash now. I reset my GitHub account password and even the access token yet it's still saying that I don't have access to push even after putting password/access token. I don't even want to talk about the commands that I've ran it all failed. Please where could this problem be coming from? I need help

Setting up proxy in Nexus Repo Manager for Github hosted Maven Repo

I am working on adding a proxy for Github Hosted maven repo. I have created the proxy and gave the remote storage url value as github url.
Anyone aware of how we can set up credentials for Nexus repo manager to talk to Github Repo. I am new to this stuff, so any help would be highly appreciated. I am guessing we might need to setup some generic user in github and created authentication token and use those for nexus to talk to Github?
Thanks in advance.

Connecting Heroku app to private GitHub repository for deploying on Heroku

I have an organization's private GitHub repository that I am trying to connect a Heroku app to, using the Heroku Dashboard from a browser. In the settings of my GitHub account (that is linked to Heroku), under OAuth Applications, I can see Heroku Dashboard, and under Permissions, it says Full control of private repositories.
However, when I navigate to the Heroku app page and select this GitHub repo from the select-list and click Connect, I get the message:
Item could not be modified:
Admin access to repository required
On GitHub, my account has Write access for the repo. Moreover, as mentioned above, Heroku Dashboard has Full control of private repositories. Can anybody help me figure out what access needs to be granted where? I would really appreciate that.
Never mind. That private GitHub repo had been created by someone else who had since left the company. I had Write access but that is not enough. When I created a new GitHub repo and an app on Heroku myself, I could connect them without any issues.
We had the same problem when someone without admin access to the github repo requested the github access in Heroku. He had to revoke his access in github before we could log back into Heroku with an account that had admin access in github and properly connect the accounts.

Host key verification failed Xcode with Mavericks Server

I'm trying to get a CI setup going and have got Mavericks server downloaded and linked with Xcode all on one machine.
Here's the set up:
Two git repos, hosted on OS X server, named CI and CISubmodule.
CISubmodule added as a submodule to CI
Every time I add bot I get a Host key verification failed error on integration. It's clear from the logs that the server is unable to clone CISubmodule due to an authentication error (I've tried SSH, HTTP, HTTPS) but I don't know why it's failing authentication.
I've set up the server so that logged in users can read and write.
I've tried everything mentioned here.
I'm guessing it's because the server is running as teamsserver and the repo is probably under my username, but I can't figure out how to give it permission to clone. Could it be that the SSH key requires a password? If so, how do I set it up so that it doesn't need a password any more?
Any guidance would be greatly appreciated.
Thanks,
Simon
I had the same case and I am not sure what happend exactly, I think the reason was I had more remote repository accesses and ssh keys pointing git-server side pointing to the same repository.
Deleting the remote repository accesses and cleaning up authorized_keys file helped.
I can confirm the CI server works with submodules, but make sure the .gitmodules file and xccheckout file point to the same repos
you may need to use passphrase-LESS keys for os x server to properly connect to 3rd party hosted git repos. it cannot connect with there is a passphrase needed.
ssh-keygen -p
it worked for us
One thing that helped me was to change my submodule URLs to use HTTPS instead of SSH.
When doing this, make sure that Xcode is actually using the new URLs. Even though I made the changes and pushed them, Xcode was caching the SSH URLs and using them. Remove all your SSH URLS from your server, then also remove them from your client under Preferences->Accounts. Then restart the server and restart Xcode, confirming that the new HTTPS URLs are being used when you create your bot.

Linking heroku app to a private(organization) github repo

Working on local, pushing changes to Heroku works and the app works as expected. However I am having trouble linking heroku app to a private repo on Github.
Current configuration looks something like this
git#github.com:{Organization}/{project}.git
Where should I configure username/password for the private repo?
I tried (even though this is not the preferred way)
username:password#github.com/{organization}/{project}.git
would appreciate any pointers regarding this.
EDIT:
I failed to mention that I am setting it under app settings in Heroku.
git#github.com:{Organization}/{project}.git
This is an ssh address, with the authentication managed by public/private key: make sure your public key is published among the collaborators' keys for that Organization.
No "username" or "password" here.
username:password#github.com/{organization}/{project}.git
That could be correct if you use that remote address as an HTTPS address.
Note that Honza Javorek mentions in "How do I access a private github repo from heroku?" in Nov. 2020:
Heroku only supports HTTP(S) Basic authentication with Git out of the box.
That's unfortunate as it means you'd need to add your credentials as part of the installation URL and commit that as plain text in your list of dependencies.
He suggests to create a new GitHub SSH key and follow the heroku-buildpack-ssh-key process:
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-ssh-key.git -i 1
heroku config:set BUILDPACK_SSH_KEY=$(cat ~/.ssh/id_rsa_heroku)
If you want to use a private repo, heroku needs to send github some sort of token as you know. If you create a deploy key on that private repo, you can use https://github.com/siassaj/heroku-buildpack-git-deploy-keys

Resources