oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.4k stars 2.78k forks source link

bun publish to GitHub Package Registry fails with 400 Bad Request / no attachments present in packument #15245

Open Korni22 opened 6 days ago

Korni22 commented 6 days ago

What version of Bun is running?

1.1.34+5e5e7c60f

What platform is your computer?

Linux 6.5.0-1025-azure x86_64 x86_64

What steps can reproduce the bug?

I am trying to use bun publish to publish a package into the GitHub Package Registry using GitHub Actions.

The job has all the permissions it takes:

permissions:
  contents: read
  id-token: write # This is required for requesting the JWT
  packages: write

I setup bun like this:

- name: Setup bun
  uses: oven-sh/setup-bun@v2
  with:
    registry-url: 'https://npm.pkg.github.com/'
    scope: '@our-org'

Install the dependencies:

- name: Install dependencies
  run: bun install --frozen-lockfile

Build the project:

- name: Build project
  run: bun run build

And try to publish:

- name: Publish package
  env:
    BUN_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    bun publish --verbose

The %2f confuses me, maybe its related to #14592 ?

What is the expected behavior?

I expected it to work, like it does with yarn (classic).

What do you see instead?

Unpacked size: 0.79MB
Packed size: 0.75MB
400 Bad Request: https://npm.pkg.github.com/@our-org%2fpackage-name
 - no attachments present in packument
Tag: latest
Access: default
Registry: https://npm.pkg.github.com/

Additional information

Maybe the package.json is the root cause?

{
  "name": "@our-org/package-name",
  "repository": "our-org/package-name",
}
rametta commented 5 days ago

I also get this error.

Image