GitHub · Arazzo Workflow

GitHub Open a Pull Request and Request Reviewers

Version 1.0.0

Open a pull request from a branch, then request reviewers on it.

1 workflow 1 source API 1 provider
View Spec View on GitHub CodePipelinesPlatformSoftware DevelopmentSource ControlT1ArazzoWorkflows

Provider

github

Workflows

open-pull-request-and-request-reviewers
Open a pull request then request reviewers on it.
Creates a pull request and chains the returned number into a call that requests the supplied reviewers.
2 steps inputs: base, body, githubToken, head, owner, repo, reviewers, title outputs: pullNumber, pullUrl
1
openPullRequest
createPullRequest
Open a pull request from the head branch to the base branch.
2
requestReviewers
requestReviewersForPullRequest
Request the supplied reviewers on the newly opened pull request using its returned number.

Source API Descriptions

Arazzo Workflow Specification

github-open-pull-request-and-request-reviewers-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: GitHub Open a Pull Request and Request Reviewers
  summary: Open a pull request from a branch, then request reviewers on it.
  description: >-
    A review-routing pattern. The workflow opens a pull request from a head
    branch to a base branch and then requests one or more reviewers on the newly
    opened pull request using the number returned by the create step. Every step
    spells out its request inline so the flow can be read and executed without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: githubRepoPullsApi
  url: ../openapi/github-repo-pulls-api-openapi.yml
  type: openapi
workflows:
- workflowId: open-pull-request-and-request-reviewers
  summary: Open a pull request then request reviewers on it.
  description: >-
    Creates a pull request and chains the returned number into a call that
    requests the supplied reviewers.
  inputs:
    type: object
    required:
    - githubToken
    - owner
    - repo
    - head
    - base
    - title
    - reviewers
    properties:
      githubToken:
        type: string
        description: A GitHub token with repo scope, passed as a Bearer credential.
      owner:
        type: string
        description: The account owner of the repository.
      repo:
        type: string
        description: The name of the repository.
      head:
        type: string
        description: The name of the branch where the changes are implemented.
      base:
        type: string
        description: The name of the branch to merge the changes into.
      title:
        type: string
        description: The title of the pull request.
      body:
        type: string
        description: The body of the pull request.
      reviewers:
        type: array
        description: The user handles to request as reviewers.
        items:
          type: string
  steps:
  - stepId: openPullRequest
    description: Open a pull request from the head branch to the base branch.
    operationId: createPullRequest
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.githubToken
    - name: owner
      in: path
      value: $inputs.owner
    - name: repo
      in: path
      value: $inputs.repo
    requestBody:
      contentType: application/json
      payload:
        title: $inputs.title
        body: $inputs.body
        head: $inputs.head
        base: $inputs.base
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      pullNumber: $response.body#/number
      pullUrl: $response.body#/html_url
  - stepId: requestReviewers
    description: >-
      Request the supplied reviewers on the newly opened pull request using its
      returned number.
    operationId: requestReviewersForPullRequest
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.githubToken
    - name: owner
      in: path
      value: $inputs.owner
    - name: repo
      in: path
      value: $inputs.repo
    - name: pull_number
      in: path
      value: $steps.openPullRequest.outputs.pullNumber
    requestBody:
      contentType: application/json
      payload:
        reviewers: $inputs.reviewers
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      requestedReviewerCount: $response.body#/requested_reviewers
  outputs:
    pullNumber: $steps.openPullRequest.outputs.pullNumber
    pullUrl: $steps.openPullRequest.outputs.pullUrl