apm icon indicating copy to clipboard operation
apm copied to clipboard

Cannot publish a new package when the default branch is called "main" instead of "master"

Open aminya opened this issue 5 years ago • 1 comments

Prerequisites

Prerequisites

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

  1. 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
  1. 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
  1. 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

aminya avatar Oct 28 '20 04:10 aminya

https://discuss.atom.io/t/apm-publish-error/79274/2 I can confirm

1000p avatar Oct 28 '20 09:10 1000p