Skip to content

fix(PL-5476): handle empty output from gh label list --json#259

Merged
silphid merged 1 commit into
masterfrom
fix/PL-5476/joy-pr-promote-with-no-labels-defined-in-repo
Apr 28, 2026
Merged

fix(PL-5476): handle empty output from gh label list --json#259
silphid merged 1 commit into
masterfrom
fix/PL-5476/joy-pr-promote-with-no-labels-defined-in-repo

Conversation

@silphid
Copy link
Copy Markdown
Contributor

@silphid silphid commented Apr 27, 2026

Description & Business motivation

As reported by @adrian.garcia in https://nestoca.atlassian.net/wiki/spaces/DEVOPS/pages/3277291535/Tool+Joy, when calling joy pr promote on a report with absolutely no labels defined gives that error:

setting promotion for branch your-branch-name pull request to "staging" environment: adding label staging to branch your-branch-name: unmarshaling label list: unexpected end of JSON input

That’s because gh label list --json ... returns an empty output when there are no labels defined in the repo, which is invalid JSON.

Comment thread internal/github/pull_request_provider.go
@silphid silphid merged commit ea03277 into master Apr 28, 2026
5 of 6 checks passed
@silphid silphid deleted the fix/PL-5476/joy-pr-promote-with-no-labels-defined-in-repo branch April 28, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants