Superface

Pull Request

vcs/pull-request@1.1.1
3 providers

PullRequest

Get details of the specified pull request.

Input
Owner
Repo
Identifier
Result
Tittle
Id
Url
Sha

1.Choose a provider

2.Use PullRequest with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('vcs/pull-request@1.1.1');

  // Use the profile
  const result = await profile
    .getUseCase('PullRequest')
    .perform({
      owner: 'superfaceai',
      repo: 'one-sdk-js',
      identifier: 42
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

owner
Owner of the repository
repo
Repository name
identifier
Id of pull request

Example

{
  "owner": "superfaceai",
  "repo": "one-sdk-js",
  "identifier": 42
}

Result (object)

title
Title of pull request
id
Pull request Id
url
Web url of pull request
sha
Pull request sha

Example

{
  "title": "feat: Better error handling",
  "id": 123456789,
  "url": "https://api.github.com/repos/superfaceai/one-sdk-js/pulls/1000",
  "sha": "2ae6d65c9fcaff064f067ba8b9123b5a3a90dcdc"
}

Implementation details

Provider
mock
Use case
PullRequest
Author
@superface
Source
Verified