workflow pr

Open a pull or merge request for the current branch

Synopsis

Compose a pull request for the checked-out branch from its commits, the issue and the repository’s template — the same as the interface — pushing the branch first when it is not yet on its remote. A preview — the title, the branches, and the whole body — is confirmed first.

The code owners of the paths the branch changes, as CODEOWNERS on the base names them, are asked to review it; the preview lists them.

–title and –body stand in for the title and description composed, and –template names the repository’s template the description starts from; –reviewer asks the people and teams it names in place of the code owners; –draft opens it as a draft; and –base merges it into another branch, drafting the title and description from the commits past it and asking its code owners.

Once it is open, it offers — as the interface does — to link it on the branch’s issue, then to move the issue to the review status (jira.review_status). With messaging set up, it ends by naming the next step, workflow announce, on stderr; with –announce, it previews the announcement on stderr instead and waits in the foreground for the pull request’s CI to pass, then announces it, as workflow announce –when-green does. A draft is not announced, so –announce refuses –draft.

–json prints what was opened, and each offer and whether it was taken, as one JSON object on stdout — under –dry-run, the pull request it would open — and says everything else, the preview included, on stderr.

workflow pr [flags]

Examples

  workflow --dry-run pr                     # what pr would push and open
  workflow pr --yes                         # push, open, link and move, without asking
  workflow pr --yes --json | jq .pull.url   # the same, and the address it opened
  workflow pr --draft --base release        # a draft into release, asking its code owners
  workflow pr --yes --announce              # open it, then announce it once CI passes

Options

      --announce[=true|false]   once it is open, wait for its CI to pass, then announce it
      --base BRANCH             merge into BRANCH instead of the base the branch left; its code owners are asked to review
      --body TEXT               the whole description, TEXT, in place of the one composed from the template and the commits
      --draft[=true|false]      open it as a draft
  -h, --help[=true|false]       help for pr
  -j, --json[=true|false]       print what was opened, and the offers that followed, as JSON
      --reviewer NAME           ask NAME to review instead of the code owners, org/team asking a team; repeat it, or separate names with commas
      --template NAME           start the description from the repository's template NAME instead of its first
      --title TEXT              the title, TEXT, in place of the one composed
  -y, --yes[=true|false]        go ahead without asking: push the branch when it needs it, open the pull request, link it on the issue and move the issue to the review status

Options inherited from parent commands

  -n, --dry-run[=true|false]   hold back every write to Jira, the forge, the messaging service, Taskwarrior, git and files, and say what it would have done
      --log-format FORMAT      say what goes to stderr as FORMAT: text, or json or logfmt, an entry a line stamped with its time (default text)
  -q, --quiet[=true|false]     say only warnings, errors and questions on stderr, leaving every note out
      --request-log FILE       append a one-line outline of each request (method, path, status, duration) to FILE, for a bug report
      --verbose[=true|false]   also say each request's outline on stderr, as a debug line (not while the terminal interface draws)

SEE ALSO

  • workflow - Run your Jira, Git forge and messaging workflow, in the terminal or a browser