Pull Requests

vcs/pull-requests@2.0.1
Supported by 3 providers
B
G
G

PullRequests

Get pull requests of the specified repository.

Input
Owner
Repo
Result
pullRequests

1.Choose a provider

2.Use PullRequests with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

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

  // Use the profile
  const result = await profile
    .getUseCase('PullRequests')
    .perform({
      owner: 'superfaceai',
      repo: 'one-sdk-js'
    }, {
      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

Example

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

Result (object)

pullRequests

Example

{
  "pullRequests": [
    {
      "title": "feat: add magic abilities",
      "id": 123456789,
      "url": "https://api.github.com/repos/superfaceai/one-sdk-js/pulls/173",
      "sha": "4z123ad91519dde1d8da2f141237b5760afd9bed"
    }
  ]
}

Implementation details

Provider
mock
Use case
PullRequests
Author
@superface
Source
Verified