diff --git a/components/github/package.json b/components/github/package.json index 9c9555b2c0a24..6992cf708f0af 100644 --- a/components/github/package.json +++ b/components/github/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/github", - "version": "1.4.0", + "version": "1.4.1", "description": "Pipedream Github Components", "main": "github.app.mjs", "keywords": [ diff --git a/components/github/sources/common/constants.mjs b/components/github/sources/common/constants.mjs index 3bcffaafea6d7..d94be0e9f455a 100644 --- a/components/github/sources/common/constants.mjs +++ b/components/github/sources/common/constants.mjs @@ -349,6 +349,11 @@ export default { value: "opened", }, ], + PULL_REQUEST_REVIEW_STATES: [ + "approved", + "changes_requested", + "commented", + ], }; export const SAMPLE_GITHUB_HEADERS = { diff --git a/components/github/sources/new-branch/new-branch.mjs b/components/github/sources/new-branch/new-branch.mjs index 15a0324a2b253..fdad80a70144b 100644 --- a/components/github/sources/new-branch/new-branch.mjs +++ b/components/github/sources/new-branch/new-branch.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-branch", name: "New Branch Created", description: "Emit new event when a branch is created.", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-card-in-column/new-card-in-column.mjs b/components/github/sources/new-card-in-column/new-card-in-column.mjs index 1dae51a0a9167..305b2eeed721b 100644 --- a/components/github/sources/new-card-in-column/new-card-in-column.mjs +++ b/components/github/sources/new-card-in-column/new-card-in-column.mjs @@ -7,7 +7,7 @@ export default { key: "github-new-card-in-column", name: "New Card in Column (Classic Projects)", description: "Emit new event when a (classic) project card is created or moved to a specific column. For Projects V2 use `New Issue with Status` trigger. [More information here](https://docs.github.com/en/issues/organizing-your-work-with-project-boards/tracking-work-with-project-boards/adding-issues-and-pull-requests-to-a-project-board)", - version: "1.0.4", + version: "1.0.5", type: "source", props: { ...common.props, diff --git a/components/github/sources/new-collaborator/new-collaborator.mjs b/components/github/sources/new-collaborator/new-collaborator.mjs index 97e4d83a7b6df..c31ea5bce2e73 100644 --- a/components/github/sources/new-collaborator/new-collaborator.mjs +++ b/components/github/sources/new-collaborator/new-collaborator.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-collaborator", name: "New Collaborator", description: "Emit new event when a collaborator is added", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-commit-comment/new-commit-comment.mjs b/components/github/sources/new-commit-comment/new-commit-comment.mjs index 418601cfbf92b..8b4b271edfb7e 100644 --- a/components/github/sources/new-commit-comment/new-commit-comment.mjs +++ b/components/github/sources/new-commit-comment/new-commit-comment.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-commit-comment", name: "New Commit Comment", description: "Emit new event when a commit comment is created", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", props: { diff --git a/components/github/sources/new-commit/new-commit.mjs b/components/github/sources/new-commit/new-commit.mjs index eb1c6332b7be3..a003402ec0eb5 100644 --- a/components/github/sources/new-commit/new-commit.mjs +++ b/components/github/sources/new-commit/new-commit.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-commit", name: "New Commit", description: "Emit new event when commits are pushed to a branch", - version: "1.0.6", + version: "1.0.7", type: "source", dedupe: "unique", props: { diff --git a/components/github/sources/new-discussion/new-discussion.mjs b/components/github/sources/new-discussion/new-discussion.mjs index c4295dccb2e7f..0b15ce1079ab5 100644 --- a/components/github/sources/new-discussion/new-discussion.mjs +++ b/components/github/sources/new-discussion/new-discussion.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-discussion", name: "New Discussion", description: "Emit new event when a discussion is created", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-fork/new-fork.mjs b/components/github/sources/new-fork/new-fork.mjs index c702ccc5d2cf8..14eeafbe944d1 100644 --- a/components/github/sources/new-fork/new-fork.mjs +++ b/components/github/sources/new-fork/new-fork.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-fork", name: "New Fork", description: "Emit new event when a repository is forked", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-issue-with-status/new-issue-with-status.mjs b/components/github/sources/new-issue-with-status/new-issue-with-status.mjs index 27a49d8069943..00cfa24c97625 100644 --- a/components/github/sources/new-issue-with-status/new-issue-with-status.mjs +++ b/components/github/sources/new-issue-with-status/new-issue-with-status.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-issue-with-status", name: "Project Item Status Changed", description: "Emit new event when a project item is tagged with a specific status. Currently supports Organization Projects only. [More information here](https://docs.github.com/en/issues/planning-and-tracking-with-projects/managing-items-in-your-project/adding-items-to-your-project)", - version: "0.1.2", + version: "0.1.3", type: "source", dedupe: "unique", props: { diff --git a/components/github/sources/new-label/new-label.mjs b/components/github/sources/new-label/new-label.mjs index 35d116c44f2cb..d8ffeb7a2942a 100644 --- a/components/github/sources/new-label/new-label.mjs +++ b/components/github/sources/new-label/new-label.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-label", name: "New Label", description: "Emit new event when a new label is created", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-or-updated-issue/new-or-updated-issue.mjs b/components/github/sources/new-or-updated-issue/new-or-updated-issue.mjs index 884d927ad03b9..d084b18d3e99a 100644 --- a/components/github/sources/new-or-updated-issue/new-or-updated-issue.mjs +++ b/components/github/sources/new-or-updated-issue/new-or-updated-issue.mjs @@ -9,7 +9,7 @@ export default { key: "github-new-or-updated-issue", name: "New or Updated Issue", description: "Emit new events when an issue is created or updated", - version: "1.1.2", + version: "1.1.3", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-or-updated-milestone/new-or-updated-milestone.mjs b/components/github/sources/new-or-updated-milestone/new-or-updated-milestone.mjs index 7a27786dd7f9a..550cc2446e5bd 100644 --- a/components/github/sources/new-or-updated-milestone/new-or-updated-milestone.mjs +++ b/components/github/sources/new-or-updated-milestone/new-or-updated-milestone.mjs @@ -9,7 +9,7 @@ export default { key: "github-new-or-updated-milestone", name: "New or Updated Milestone", description: "Emit new event when a milestone is created or updated", - version: "1.1.2", + version: "1.1.3", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-or-updated-pull-request/new-or-updated-pull-request.mjs b/components/github/sources/new-or-updated-pull-request/new-or-updated-pull-request.mjs index 68683030f3bc7..f928875ae0d12 100644 --- a/components/github/sources/new-or-updated-pull-request/new-or-updated-pull-request.mjs +++ b/components/github/sources/new-or-updated-pull-request/new-or-updated-pull-request.mjs @@ -9,7 +9,7 @@ export default { key: "github-new-or-updated-pull-request", name: "New or Updated Pull Request", description: "Emit new event when a pull request is opened or updated", - version: "1.2.2", + version: "1.2.3", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-release/new-release.mjs b/components/github/sources/new-release/new-release.mjs index 1cc2fbba8bb27..d670ca3b3dce7 100644 --- a/components/github/sources/new-release/new-release.mjs +++ b/components/github/sources/new-release/new-release.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-release", name: "New release", description: "Emit new event when a new release is created", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-star/new-star.mjs b/components/github/sources/new-star/new-star.mjs index 1c28c8f79c4b5..37c7f6bc5e013 100644 --- a/components/github/sources/new-star/new-star.mjs +++ b/components/github/sources/new-star/new-star.mjs @@ -8,7 +8,7 @@ export default { key: "github-new-star", name: "New Stars", description: "Emit new event when a repository is starred", - version: "1.0.5", + version: "1.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/webhook-events/webhook-events.mjs b/components/github/sources/webhook-events/webhook-events.mjs index 7dc65a0e40af1..fc6787ef705c0 100644 --- a/components/github/sources/webhook-events/webhook-events.mjs +++ b/components/github/sources/webhook-events/webhook-events.mjs @@ -8,7 +8,8 @@ export default { name: "New Webhook Event (Instant)", description: "Emit new event for each selected event type", type: "source", - version: "1.0.5", + version: "1.0.6", + dedupe: "unique", props: { docsInfo: { type: "alert", @@ -21,9 +22,23 @@ export default { description: "The event types to be emitted", type: "string[]", options: constants.REPOSITORY_WEBHOOK_EVENTS, + reloadProps: true, }, }, - dedupe: "unique", + async additionalProps() { + await this.requireAdminPermission(); + const props = {}; + if (this.events?.length && this.events.includes("pull_request_review")) { + props.reviewState = { + type: "string", + label: "Review State", + description: "Filter `pull_request_review` events by review state", + options: constants.PULL_REQUEST_REVIEW_STATES, + optional: true, + }; + } + return props; + }, methods: { ...common.methods, getWebhookEvents() { @@ -42,6 +57,10 @@ export default { return; } + if (headers["x-github-event"] === "pull_request_review" && this.reviewState && body.review.state !== this.reviewState) { + return; + } + this.$emit({ ...getRelevantHeaders(headers), ...body,