Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

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

Open
1 task done
aminya opened this issue Oct 28, 2020 · 1 comment
Open
1 task done
Labels

Comments

@aminya
Copy link
Contributor

aminya commented Oct 28, 2020

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
@1000p
Copy link

1000p commented Oct 28, 2020

sjbarag added a commit to theme-controller/thcon-atom that referenced this issue Mar 8, 2021
`apm publish` doesn't seem to allow non-`master` branches.  Switch to
`main` until atom/apm#908 is resolved.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants