NicoHood / GPGit

A shell script that automates the process of signing Git sources via GPG
MIT License
89 stars 10 forks source link

Github upload fails if no branch exists upstream (On blank repositories) #36

Open NicoHood opened 2 years ago

NicoHood commented 2 years ago

How to reproduce:

  1. Create a whole new repository via Github
  2. Clone it locally
  3. Make a commit but don't push
  4. Run gpgit and it will fail

The error:

==> 5. Upload the release
  -> 5.1 Configure HTTPS download server
    Github uses well configured https.
  -> 5.2 Upload to Github
    Creating new Github release '0.2.0'.
==> ERROR: Github API message: 'Validation Failed'. Check your token configuration: https://github.com/settings/tokens

The error is quite missleading. It happens because no branch exists upstream, so the release cannot be tagged onto that branch. We should either push the current branch (which has pro & cons) or detect that issue as early as possible.