Expected Behavior
When frog/sync already has an open pull request, the Action finds and updates that pull request.
Current Behavior
The Action requests headRepository and headRepositoryOwner from gh pr list, then compares .headRepository.nameWithOwner with the full repository name.
The GitHub CLI exposes .headRepository.name, but nameWithOwner is an empty string in this response. The comparison rejects the existing pull request. Later steps can then treat the pull request as absent.
Possible Solution
Compare both fields that the CLI populates:
.headRepositoryOwner.login == $owner and
.headRepository.name == $name
Derive $owner and $name separately from GITHUB_REPOSITORY.
Minimal Reproducible Example
For a repository with an open pull request, run:
gh pr list \
--head frog/sync \
--state open \
--json number,headRepository,headRepositoryOwner
The repository object has this shape:
{
"headRepository": {
"name": "repo",
"nameWithOwner": ""
},
"headRepositoryOwner": {
"login": "owner"
}
}
The current nameWithOwner == "owner/repo" condition is therefore false.
Context
The affected comparison is in action/action.yml at commit 702c4eadefe175a208290a99c36e7f4ac1390e53.
Expected Behavior
When
frog/syncalready has an open pull request, the Action finds and updates that pull request.Current Behavior
The Action requests
headRepositoryandheadRepositoryOwnerfromgh pr list, then compares.headRepository.nameWithOwnerwith the full repository name.The GitHub CLI exposes
.headRepository.name, butnameWithOwneris an empty string in this response. The comparison rejects the existing pull request. Later steps can then treat the pull request as absent.Possible Solution
Compare both fields that the CLI populates:
Derive
$ownerand$nameseparately fromGITHUB_REPOSITORY.Minimal Reproducible Example
For a repository with an open pull request, run:
gh pr list \ --head frog/sync \ --state open \ --json number,headRepository,headRepositoryOwnerThe repository object has this shape:
{ "headRepository": { "name": "repo", "nameWithOwner": "" }, "headRepositoryOwner": { "login": "owner" } }The current
nameWithOwner == "owner/repo"condition is therefore false.Context
The affected comparison is in
action/action.ymlat commit702c4eadefe175a208290a99c36e7f4ac1390e53.