← RSS + GitHub integrations

Get Reviewers with GitHub API on New Item in Feed from RSS API

Pipedream makes it easy to connect APIs for GitHub, RSS and 900+ other apps remarkably fast.

Trigger workflow on
New Item in Feed from the RSS API
Next, do this
Get Reviewers with the GitHub API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

This integration creates a workflow with a RSS trigger and GitHub action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Item in Feed trigger
    1. Connect your RSS account
    2. Configure timer
    3. Configure Feed URL
  3. Configure the Get Reviewers action
    1. Connect your GitHub account
    2. Select a Repository
    3. Optional- Select a PR Number
    4. Optional- Configure Commit SHA
    5. Optional- Select one or more Review States
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, open source components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new items from an RSS feed
Version:1.0.3
Key:rss-new-item-in-feed

Trigger Code

import rss from "../../app/rss.app.mjs";
import { defineSource } from "@pipedream/types";
import rssCommon from "../common/common.mjs";
export default defineSource({
    ...rssCommon,
    key: "rss-new-item-in-feed",
    name: "New Item in Feed",
    description: "Emit new items from an RSS feed",
    version: "1.0.3",
    type: "source",
    dedupe: "unique",
    props: {
        ...rssCommon.props,
        url: {
            propDefinition: [
                rss,
                "url",
            ],
        },
    },
    hooks: {
        async activate() {
            // Try to parse the feed one time to confirm we can fetch and parse.
            // The code will throw any errors to the user.
            await this.rss.fetchAndParseFeed(this.url);
        },
    },
    async run() {
        const items = await this.rss.fetchAndParseFeed(this.url);
        this.rss.sortItems(items).forEach((item) => {
            const meta = this.generateMeta(item);
            this.$emit(item, meta);
        });
    },
});

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
RSSrssappThis component uses the RSS app.
timer$.interface.timer

How often you want to poll the feed for new items

Feed URLurlstring

Enter the URL for any public RSS feed

Trigger Authentication

The RSS API does not require authentication.

About RSS

Real Simple Syndication

Action

Description:Get reviewers for a PR ([see docs](https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request)) or Commit SHA ([see docs](https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit)).
Version:0.0.2
Key:github-get-reviewers

Action Code

import github from "../../github.app.mjs";
import constants from "../common/constants.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
  key: "github-get-reviewers",
  name: "Get Reviewers",
  description: "Get reviewers for a PR ([see docs](https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request)) or Commit SHA ([see docs](https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit)).",
  version: "0.0.2",
  type: "action",
  props: {
    github,
    repoFullname: {
      propDefinition: [
        github,
        "repoFullname",
      ],
    },
    pullNumber: {
      propDefinition: [
        github,
        "pullNumber",
        (c) => ({
          repoFullname: c.repoFullname,
        }),
      ],
      optional: true,
    },
    commitSha: {
      type: "string",
      label: "Commit SHA",
      description: "A commit SHA. This field will have precendence over **PR Number**",
      optional: true,
    },
    reviewStates: {
      type: "string[]",
      label: "Review States",
      description: "Filter by these review states. Default includes `APPROVED` and `CHANGES_REQUESTED` only",
      options: constants.PULL_REQUEST_STATES,
      optional: true,
    },
  },
  methods: {
    getReviewers(reviews) {
      const reviewers = reviews
        .filter((review) => {
          if (this.reviewStates?.length) {
            return this.reviewStates.includes(review.state); // user-defined states
          }
          return [
            "APPROVED",
            "CHANGES_REQUESTED",
          ].includes(review.state); // default states
        })
        .map((review) => review.user.login);
      return this.uniqueReviewers(reviewers);
    },
    uniqueReviewers(reviewers) {
      return [
        ...new Set(reviewers),
      ];
    },
  },
  async run({ $ }) {
    if (!(this.pullNumber || this.commitSha)) {
      throw new ConfigurationError("Please provide a **PR Number** or a **Commit SHA**");
    }

    let pullNumber = this.pullNumber;

    if (this.commitSha) {
      const pr = await this.github.getPullRequestForCommit({
        repoFullname: this.repoFullname,
        sha: this.commitSha,
      });

      if (!pr?.number) {
        $.export("$summary", "No PR associated with this commit");
        return;
      }

      pullNumber = pr.number;
    }

    const reviews = await this.github.getReviewsForPullRequest({
      repoFullname: this.repoFullname,
      pullNumber,
    });

    const reviewers = this.getReviewers(reviews);

    $.export("$summary", "Successfully retrieved reviewers.");

    return reviewers;
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
GitHubgithubappThis component uses the GitHub app.
RepositoryrepoFullnamestringSelect a value from the drop down menu.
PR NumberpullNumberintegerSelect a value from the drop down menu.
Commit SHAcommitShastring

A commit SHA. This field will have precendence over PR Number

Review StatesreviewStatesstring[]Select a value from the drop down menu:APPROVEDCHANGES_REQUESTEDCOMMENTEDDISMISSEDPENDING

Action Authentication

GitHub uses OAuth authentication. When you connect your GitHub account, Pipedream will open a popup window where you can sign into GitHub and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any GitHub API.

Pipedream requests the following authorization scopes when you connect your account:

repoadmin:orgadmin:public_keyadmin:org_hookgistprojectnotificationsuserwrite:discussionwrite:packagesread:packagesadmin:repo_hook

About GitHub

Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.

More Ways to Connect GitHub + RSS

Create Issue Comment with GitHub API on New Item in Feed from RSS API
RSS + GitHub
 
Try it
Create Issue with GitHub API on New Item in Feed from RSS API
RSS + GitHub
 
Try it
Get Issue Assignees with GitHub API on New Item in Feed from RSS API
RSS + GitHub
 
Try it
Get Repository Content with GitHub API on New Item in Feed from RSS API
RSS + GitHub
 
Try it
Get Repository with GitHub API on New Item in Feed from RSS API
RSS + GitHub
 
Try it
New Item in Feed from the RSS API

Emit new items from an RSS feed

 
Try it
New Item From Multiple RSS Feeds from the RSS API

Emit new items from multiple RSS feeds

 
Try it
Random item from multiple RSS feeds from the RSS API

Emit a random item from multiple RSS feeds

 
Try it
Custom Webhook Events from the GitHub API

Emit new events of selected types

 
Try it
New Branch (Instant) from the GitHub API

Emit new events when a new branch is created

 
Try it
Merge RSS Feeds with the RSS API

Retrieve multiple RSS feeds and return a merged array of items sorted by date See docs

 
Try it
Create Issue with the GitHub API

Create a new issue in a Gihub repo. See docs here

 
Try it
Search Issues and Pull Requests with the GitHub API

Find issues and pull requests by state and keyword. See docs here

 
Try it
Create Issue Comment with the GitHub API

Create a new comment in a issue. See docs here

 
Try it
Get Issue Assignees with the GitHub API

Get assignees for an issue in a Gihub repo. See docs here

 
Try it