changelogen icon indicating copy to clipboard operation
changelogen copied to clipboard

Changelogen not creating the release when authenticated with gh cli

Open danielpza opened this issue 1 year ago • 0 comments

Environment

package and node version

❯ npm why changelogen
[email protected] dev
❯ node --version
v22.4.1

OS: linux

Reproduction

https://github.com/danielpza/changelog-gh-cli-issue

Describe the bug

changelogen doesn't pick the authentication from the gh cli when creating a new release

On https://github.com/unjs/changelogen?tab=readme-ov-file#changelogen-gh-release:

By default in unauthenticated mode, changelogen will open a browser link to make manual release. By providing github token, it can be automated.

  • Using GitHub CLI token when authenticated with gh auth login

Locally:

❯ gh auth status
github.com
  ✓ Logged in to github.com account danielpza (keyring)

❯ npm run release

> [email protected] release
> changelogen --release --push

ℹ Generating changelog for ...master                                                                                                 6:09:56 PM
ℹ Bumping npm package version from 0.0.0 to 0.0.1 (patch)                                                                            6:09:56 PM
ℹ Creating  /home/daniel/projects/changelog-gh-cli-issue/CHANGELOG.md                                                                6:09:56 PM
ℹ Followup in the browser to manually create the release.                                                                            6:09:58 PM

However when feeding the GH token manually it does work as expected:

❯ GH_TOKEN=$(gh auth token) npm run release

> [email protected] release
> changelogen --release --push

ℹ Generating changelog for v0.0.1...v0.0.1                                                                                           6:11:08 PM
ℹ Bumping npm package version from 0.0.1 to 0.0.2 (patch)                                                                            6:11:08 PM
ℹ Updating /home/daniel/projects/changelog-gh-cli-issue/CHANGELOG.md                                                                 6:11:08 PM
✔ Synced v0.0.2 to Github releases!                                                                                                  6:11:10 PM

Additional context

No response

Logs

No response

### Tasks

danielpza avatar Aug 07 '24 22:08 danielpza