You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh pr edit --add-reviewer requires checkout of a very specific branch #10071
Where does ${PR_NUMBER} number come from? Are you sure it is set correctly? You're right that pr edit should not be looking up the branch name if you've provided the PR number and GH_REPO.
➜ GH_REPO=williammartin-test-org/test-repo gh pr edit 3 --title test
https://github.com/williammartin-test-org/test-repo/pull/3
Which further makes me wonder whether there's any chance PR_NUMBER is unset, and therefore this is resolving to something like:
➜ cd /tmp
➜ /tmp GH_REPO=williammartin-test-org/test-repo gh pr edit --title test
could not determine current branch: failed to run git: fatal: not a git repository (or any of the parent directories): .git
@fregante I would make sure that when that step runs, that the CWD is still in the repository. I don't think we've made changes to the way the repo resolution works, but maybe I'm wrong.
Can you provide the full workflow YAML please? Redact anything you need to.
But that's the point, I passed a full URL to the resource so it knows the repo already. gh is perfectly able to run from any folder, in fact it works with the explicit --repo flag.
Can you provide the full workflow YAML please? Redact anything you need to.
Here's the workflow minus some extra conditions to add/remove certain labels
Hi there, I see gh pr edit started to fail once 4 days ago, and continuously 2 days ago. It's open source so you can see the workflow and action build history:
Activity
williammartin commentedon Dec 16, 2024
Hey @TWiStErRob,
Where does
${PR_NUMBER}number come from? Are you sure it is set correctly? You're right thatpr editshould not be looking up the branch name if you've provided the PR number andGH_REPO.Also, just as an aside, I think you could probably provide the
pull_request.urlas an argument and not setGH_REPOat all: https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_requestI'll have another look at the code and see whether I can spot anything unusual.
williammartin commentedon Dec 16, 2024
FWIW this worked for me:
Which further makes me wonder whether there's any chance PR_NUMBER is unset, and therefore this is resolving to something like:
TWiStErRob commentedon Dec 16, 2024
PR_NUMBERis set correctly, defined inenv:right below the line.It's strange that it works now. In a public open-source repo it's the image above, when running in an internal cloud org we get #6274.
We couldn't've been hallucinating this thought, I'll try to see if I can dig up some history.
That's a top tip! Thanks.
fregante commentedon May 30, 2025
I've been using this for a while and this week it started failing
Using
--repomade it work again, this is probably a regression:BagToad commentedon May 30, 2025
@fregante I would make sure that when that step runs, that the CWD is still in the repository. I don't think we've made changes to the way the repo resolution works, but maybe I'm wrong.
Can you provide the full workflow YAML please? Redact anything you need to.
fregante commentedon May 30, 2025
But that's the point, I passed a full URL to the resource so it knows the repo already.
ghis perfectly able to run from any folder, in fact it works with the explicit--repoflag.Here's the workflow minus some extra conditions to add/remove certain labels
gr2m commentedon May 31, 2025
Hi there, I see
gh pr editstarted to fail once 4 days ago, and continuously 2 days ago. It's open source so you can see the workflow and action build history:https://github.com/vercel/ai/actions/workflows/assign-team-pull-request.yml
Please let me know if there is anything we can do to debug this.
user202729 commentedon Jun 2, 2025
I open a new issue regarding the new bug (since this one is old it's likely a different bug, but might have the same cause)
#11055 (comment)
BagToad commentedon Jun 3, 2025
@fregante Sorry, I just realized I did not reply to you! Thank you for clarifying and you're absolutely right.
@williammartin has a quick fix out for this in #11057 and we'll do a patch release soon to publish it.