-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
I have seen manual PR number configuration has been added for workflow_dispatch, but it's actually not needed as gh cli can provide that number easily.
$ gh pr status --json 'number,title,url' --jq '.currentBranch'{
"number": 123,
"title": "Dummy PR title",
"url": "https://github.com/ORG/REPO/pull/123"
}So this should give back what we need:
$ gh pr status --json 'number' --jq '.currentBranch.number'
123I'm not sure if/when I will have time to contribute this.
ps.: This works as well.
$ gh pr view --json 'number,title,url'{
"number": 123,
"title": "Dummy PR title",
"url": "https://github.com/ORG/REPO/pull/123"
}So
$ gh pr view --json 'number' --jq '.number'
123BTW this won't provide it only for on: workflow_dispatch, but even on: push can be used now as well. Also pull_request and pull_request_target checks can be replaced, because we can have all the values we have there with push and workflow_dispatch as well.
$ gh pr view --json 'number,headRefOid,headRefName'{
"headRefName": "dummy_branch_name",
"headRefOid": "559d819bfa003066d812151a61ce1ff4ee559c9a",
"number": 123
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels