-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Describe the bug
When I run a gh pr list --search <SHA> --json number
query locally I get the desired output of a PR number. But when that same query is run in a GitHub action it outputs an empty JSON array. The SHA is for a merge commit on master. In both instances, a feature branch is checked out, if that matters. The action has the pull-requests: read
permission. I've tried git fetch origin master
in case that mattered, but the query still came up empty. I've also tried running the query with the base
and head
flags (individually; set to master). Also, this is in an enterprise org/repo, if that matters. Any ideas on why this might be?
Affected version
gh version 2.74.2 (2025-06-17)
https://github.com/cli/cli/releases/tag/v2.74.2
Steps to reproduce the behavior
See description.
Expected vs actual behavior
I expected the outputs to be consistent between the two environments (locally and actions)
Logs
Paste the activity from your command line. Redact if needed.