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'
123
I'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'
123
BTW 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
}
I have seen manual PR number configuration has been added for
workflow_dispatch, but it's actually not needed asgh clican provide that number easily.{ "number": 123, "title": "Dummy PR title", "url": "https://github.com/ORG/REPO/pull/123" }So this should give back what we need:
I'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
BTW this won't provide it only for
on: workflow_dispatch, but evenon: pushcan be used now as well. Alsopull_requestandpull_request_targetchecks can be replaced, because we can have all the values we have there withpushandworkflow_dispatchas well.$ gh pr view --json 'number,headRefOid,headRefName'{ "headRefName": "dummy_branch_name", "headRefOid": "559d819bfa003066d812151a61ce1ff4ee559c9a", "number": 123 }