Issue
When I'm trying to deploy the application which is connected to Github, I'm getting "Item could not be created: unauthorized" error message.
Resolution
The error message you are getting typically indicates that the action you are trying to perform has been denied due to lack of authorization i.e. when GitHub tokens are invalid. Toggling the GitHub connection (reauthorizing GitHub access) should generate new tokens and should resolve the issue.
Below are the recommendations based on your configuration:
-
If you have enabled automatic deploys for your application, you can visit the applications tab from your Account Settings to disconnect/re-connect your Github account with Heroku.
Article for reference: https://devcenter.heroku.com/articles/github-integration#disconnecting-account -
If your Heroku account is not linked to GitHub, disconnect/reconnect the app to GitHub from the deploy tab of the application.
-
If the application is part of a pipeline, you can navigate to the Pipeline Settings tab to disconnect/re-connect to GitHub. Article for reference: https://help.heroku.com/UIUA61EH/how-do-i-reconnect-the-github-integration.