Cannot publish a new package when the default branch is called "main" instead of "master"
Prerequisites
Prerequisites
- [x] Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
When the default branch of a repository is called main (this is currently the default behavior of GitHub), you cannot publish the apm package.
This is the kind of error that will be thrown:
❯ apm publish patch
Registering atom-ide-console failed
Registering package in atom-ide-community/atom-ide-console repository failed: That repo does not exist, isn't an atom package, or you do not have access
Manually tagging and using `apm publish --tag "v0.1.0" does not help either.
Current workaround
The only solution I have found is to make a branch from the main branch and call it "master". Make it the default branch in the GitHub settings. Then, publish the package.
git branch -m main master
git push -u origin master
# go to Github/settings/branches and change the default branch to master
apm publish patch
Steps to Reproduce
- Create a new GitHub repository and make the default branch name "main"
makdir test-package-main
cd test-package-main
git init
gh create repo
git checkout -b main
- Create an atom package in the same repository
apm init --package .
git add . && git commit --message "test-package-main"
git push --set-upstream origin main
- Try to publish
apm publish patch
Here is the ready repository to test: https://github.com/aminya/test-package-main
Expected behavior:
Publish
Actual behavior:
See the above description.
Reproduces how often: Always
Versions
❯ apm --version
apm 2.5.2
npm 6.14.8
node 12.4.0 x64
atom 1.52.0
python 2.7.9
git 2.29.1.windows.1
visual studio
https://discuss.atom.io/t/apm-publish-error/79274/2 I can confirm