Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot push Go module to empty repository #1327

Open
hakenmt opened this issue Aug 22, 2024 · 0 comments
Open

Cannot push Go module to empty repository #1327

hakenmt opened this issue Aug 22, 2024 · 0 comments

Comments

@hakenmt
Copy link

hakenmt commented Aug 22, 2024

Running the release worfklow and publishing a Go module. The targeted github repo is empty, no commits. This results in an error.

warning: You appear to have cloned an empty repository.
fatal: bad sha1 reference origin/main
error: pathspec 'main' did not match any file(s) known to git
/root/.npm/_npx/09fe13222ade61c7/node_modules/publib/lib/help/shell.js:56
        throw new Error(message);
        ^

Error: 
    Command failed: git checkout main.
      Output: undefined
      Error: undefined
    at Object.run (/root/.npm/_npx/09fe13222ade61c7/node_modules/publib/lib/help/shell.js:56:15)
    at Object.checkout (/root/.npm/_npx/09fe13222ade61c7/node_modules/publib/lib/help/git.js:175:11)
    at GoReleaser.doRelease (/root/.npm/_npx/09fe13222ade61c7/node_modules/publib/lib/targets/go.js:85:13)
    at GoReleaser.release (/root/.npm/_npx/09fe13222ade61c7/node_modules/publib/lib/targets/go.js:76:25)
    at Object.<anonymous> (/root/.npm/_npx/09fe13222ade61c7/node_modules/publib/lib/bin/publib-golang.js:37:10)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)

Making a commit with like a README file fixes the issue, but if this is a first run, I think it should be acceptable to have an empty repo.

https://github.com/bamcis-io/multi-az-observability/actions/runs/10511736592/job/29123629210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant