From 995077ecf684a146b5199ef177727c4aec13554a Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sat, 21 Sep 2024 19:03:31 -0300 Subject: [PATCH 01/29] Create Issue adjustments + get push permission + improvements --- .../actions/create-issue/create-issue.mjs | 43 +++++++++++++++---- components/github/common/utils.mjs | 25 +++++++++++ components/github/github.app.mjs | 15 +++++++ .../github/sources/common/common-flex.mjs | 5 +-- .../github/sources/common/common-webhook.mjs | 2 +- components/github/sources/common/utils.mjs | 10 ----- 6 files changed, 77 insertions(+), 23 deletions(-) diff --git a/components/github/actions/create-issue/create-issue.mjs b/components/github/actions/create-issue/create-issue.mjs index 5937af316972d..6e6b9e36c9ef4 100644 --- a/components/github/actions/create-issue/create-issue.mjs +++ b/components/github/actions/create-issue/create-issue.mjs @@ -1,3 +1,4 @@ +import { checkPushPermission } from "../../common/utils.mjs"; import github from "../../github.app.mjs"; export default { @@ -13,6 +14,7 @@ export default { github, "repoFullname", ], + reloadProps: true, }, title: { label: "Title", @@ -49,19 +51,42 @@ export default { }), ], }, + milestone: { + propDefinition: [ + github, + "milestoneNumber", + (c) => ({ + repoFullname: c.repoFullname, + }), + ], + }, + }, + methods: { + checkPushPermission, + }, + async additionalProps() { + const canPush = await this.checkPushPermission(); + return canPush + ? {} + : { + infoBox: { + type: "alert", + alertType: "info", + content: "Labels, assignees and milestones can only be set by users with push access to the repository.", + }, + }; }, async run({ $ }) { - const response = await this.github.createIssue({ - repoFullname: this.repoFullname, - data: { - title: this.title, - body: this.body, - labels: this.labels, - assignees: this.assignees, - }, + const { // eslint-disable-next-line no-unused-vars + github, repoFullname, infoBox, ...data + } = this; + + const response = await github.createIssue({ + repoFullname, + data, }); - $.export("$summary", "Successfully created issue."); + $.export("$summary", `Successfully created issue (ID: ${response.id})`); return response; }, diff --git a/components/github/common/utils.mjs b/components/github/common/utils.mjs index e011fd87c8355..a57a5895fc9b0 100644 --- a/components/github/common/utils.mjs +++ b/components/github/common/utils.mjs @@ -20,3 +20,28 @@ export function toSingleLineString(multiLineString) { .replace(/\n/g, " ") .replace(/\s{2,}/g, " "); } + +async function getUserRepoPermissions(github, repoFullname) { + const { login: username } = await github.getAuthenticatedUser(); + const { user: { permissions } } = await github.getUserRepoPermissions({ + repoFullname, + username, + }); + return permissions; +} + +export async function checkAdminPermission() { + const { + github, repoFullname, + } = this; + const { admin } = await getUserRepoPermissions(github, repoFullname); + return admin; +} + +export async function checkPushPermission() { + const { + github, repoFullname, + } = this; + const { push } = await getUserRepoPermissions(github, repoFullname); + return push; +} diff --git a/components/github/github.app.mjs b/components/github/github.app.mjs index f13db7dccc78f..cf9f99e96694b 100644 --- a/components/github/github.app.mjs +++ b/components/github/github.app.mjs @@ -206,6 +206,21 @@ export default { })); }, }, + milestoneNumber: { + type: "integer", + label: "Milestone Number", + description: "The number of a milestone to associate this issue with.", + async options({ repoFullname }) { + const items = await this.getRepositoryMilestones({ + repoFullname, + }); + + return items.map((item) => ({ + label: item.title, + value: +item.number, + })); + }, + }, column: { label: "Column", description: "The column in a project board", diff --git a/components/github/sources/common/common-flex.mjs b/components/github/sources/common/common-flex.mjs index df4dfe5095440..4320a8b197c88 100644 --- a/components/github/sources/common/common-flex.mjs +++ b/components/github/sources/common/common-flex.mjs @@ -1,8 +1,7 @@ import github from "../../github.app.mjs"; import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; -import { - checkAdminPermission, getRelevantHeaders, -} from "./utils.mjs"; +import { getRelevantHeaders } from "./utils.mjs"; +import { checkAdminPermission } from "../../common/utils.mjs"; export default { props: { diff --git a/components/github/sources/common/common-webhook.mjs b/components/github/sources/common/common-webhook.mjs index 897b54703d95f..fa022146905bb 100644 --- a/components/github/sources/common/common-webhook.mjs +++ b/components/github/sources/common/common-webhook.mjs @@ -1,6 +1,6 @@ import { ConfigurationError } from "@pipedream/platform"; import github from "../../github.app.mjs"; -import { checkAdminPermission } from "./utils.mjs"; +import { checkAdminPermission } from "../../common/utils.mjs"; export default { props: { diff --git a/components/github/sources/common/utils.mjs b/components/github/sources/common/utils.mjs index 46becffea085b..e5a0f8eafd2b3 100644 --- a/components/github/sources/common/utils.mjs +++ b/components/github/sources/common/utils.mjs @@ -1,13 +1,3 @@ -export async function checkAdminPermission() { - const { repoFullname } = this; - const { login: username } = await this.github.getAuthenticatedUser(); - const { user: { permissions: { admin } } } = await this.github.getUserRepoPermissions({ - repoFullname, - username, - }); - return admin; -} - export async function checkOrgAdminPermission() { const { org } = this; const { login: username } = await this.github.getAuthenticatedUser(); From ed0e29be345c8fc15b7c7f34683a72a8d8c9d524 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sat, 21 Sep 2024 19:40:53 -0300 Subject: [PATCH 02/29] Create Issue + async props --- .../github/actions/common/asyncProps.mjs | 44 +++++++++++++++++ .../actions/create-issue/create-issue.mjs | 47 ++++--------------- 2 files changed, 54 insertions(+), 37 deletions(-) create mode 100644 components/github/actions/common/asyncProps.mjs diff --git a/components/github/actions/common/asyncProps.mjs b/components/github/actions/common/asyncProps.mjs new file mode 100644 index 0000000000000..9b1bee33e7e7d --- /dev/null +++ b/components/github/actions/common/asyncProps.mjs @@ -0,0 +1,44 @@ +export default { + assignees: { + label: "Assignees", + description: "One or more Users to assign to this issue", + type: "string[]", + optional: true, + options: async () => { + const collaborators = await this.github.getRepositoryCollaborators({ + repoFullname: this.repoFullname, + }); + + return collaborators.map(({ login }) => login); + }, + }, + labels: { + label: "Labels", + description: "The label(s) to add to the issue", + type: "string[]", + optional: true, + options: async () => { + const labels = await this.github.getRepositoryLabels({ + repoFullname: this.repoFullname, + }); + + return labels.map(({ name }) => name); + }, + }, + milestoneNumber: { + type: "integer", + label: "Milestone Number", + description: "The number of a milestone to associate the issue with", + optional: true, + options: async () => { + const items = await this.github.getRepositoryMilestones({ + repoFullname: this.repoFullname, + }); + + return items.map((item) => ({ + label: item.title, + value: +item.number, + })); + }, + }, +}; diff --git a/components/github/actions/create-issue/create-issue.mjs b/components/github/actions/create-issue/create-issue.mjs index 6e6b9e36c9ef4..72581fe62d7e0 100644 --- a/components/github/actions/create-issue/create-issue.mjs +++ b/components/github/actions/create-issue/create-issue.mjs @@ -1,11 +1,12 @@ import { checkPushPermission } from "../../common/utils.mjs"; import github from "../../github.app.mjs"; +import asyncProps from "../common/asyncProps.mjs"; export default { key: "github-create-issue", name: "Create Issue", - description: "Create a new issue in a Gihub repo. [See docs here](https://docs.github.com/en/rest/issues/issues#create-an-issue)", - version: "0.2.16", + description: "Create a new issue in a Gihub repo. [See the documentation](https://docs.github.com/en/rest/issues/issues#create-an-issue)", + version: "0.3.{{ts}}", type: "action", props: { github, @@ -23,51 +24,23 @@ export default { }, body: { label: "Body", - description: "The contents of the issue", + description: "The text body of the issue", type: "string", optional: true, }, - labels: { - label: "Labels", - description: "Labels to associate with this issue. NOTE: Only users with push access can set labels for new issues", - optional: true, - propDefinition: [ - github, - "labels", - (c) => ({ - repoFullname: c.repoFullname, - }), - ], - }, - assignees: { - label: "Assignees", - description: "Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues", - optional: true, - propDefinition: [ - github, - "collaborators", - (c) => ({ - repoFullname: c.repoFullname, - }), - ], - }, - milestone: { - propDefinition: [ - github, - "milestoneNumber", - (c) => ({ - repoFullname: c.repoFullname, - }), - ], - }, }, methods: { checkPushPermission, }, async additionalProps() { const canPush = await this.checkPushPermission(); + console.log("canPush", canPush); return canPush - ? {} + ? { + assignees: asyncProps.assignees, + labels: asyncProps.labels, + milestoneNumber: asyncProps.milestoneNumber, + } : { infoBox: { type: "alert", From 2e82e77c95f4ef7eb1193f56db1ff816a0006c6e Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sat, 21 Sep 2024 19:46:49 -0300 Subject: [PATCH 03/29] Get Repository improvements --- .../github/actions/get-repository/get-repository.mjs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/github/actions/get-repository/get-repository.mjs b/components/github/actions/get-repository/get-repository.mjs index 7b6e65cd78fa2..faab708a2c64b 100644 --- a/components/github/actions/get-repository/get-repository.mjs +++ b/components/github/actions/get-repository/get-repository.mjs @@ -2,9 +2,9 @@ import github from "../../github.app.mjs"; export default { key: "github-get-repository", - name: "Get Repository", - description: "Get specific repository. [See docs here](https://docs.github.com/en/rest/repos/repos#get-a-repository)", - version: "0.0.17", + name: "Get Repository Info", + description: "Get information for a specific repository. [See the documentation](https://docs.github.com/en/rest/repos/repos#get-a-repository)", + version: "0.0.18", type: "action", props: { github, @@ -16,11 +16,12 @@ export default { }, }, async run({ $ }) { + const { repoFullname } = this; const response = await this.github.getRepo({ - repoFullname: this.repoFullname, + repoFullname, }); - $.export("$summary", "Successfully retrieved repository."); + $.export("$summary", `Successfully retrieved repository ${repoFullname}`); return response; }, From 2cab7ffb1c08b5ee8f1f1e95bd52de3aabba36de Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sat, 21 Sep 2024 20:38:49 -0300 Subject: [PATCH 04/29] Search issues/prs improvements --- .../search-issues-and-pull-requests.mjs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs b/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs index 58eb3d0c7e205..26ffacfede4c8 100644 --- a/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs +++ b/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs @@ -3,27 +3,36 @@ import github from "../../github.app.mjs"; export default { key: "github-search-issues-and-pull-requests", name: "Search Issues and Pull Requests", - description: "Find issues and pull requests by state and keyword. [See docs here](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests)", - version: "0.1.16", + description: "Find issues and pull requests by state and keyword. [See the documentation](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests)", + version: "0.2.{{ts}}", type: "action", props: { github, + infoBox: { + type: "alert", + alertType: "info", + content: `Example query: \`bug report in:title type:issue repo:octocat/Hello-World\` + +This will return issues in the repository [octocat/Hello-World](https://github.com/octocat/Hello-World) with the title including the words "bug report".`, + }, query: { label: "Query", - description: "The query contains one or more search keywords and qualifiers", + description: "The query contains one or more search keywords and qualifiers. [See the documentation](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests) for more information and examples", type: "string", }, maxResults: { label: "Maximum Results", - description: "The maximum of resources that will be returned", + description: "The maximum amount of items to retrieve", type: "integer", default: 100, }, }, - async run() { - return this.github.searchIssueAndPullRequests({ + async run({ $ }) { + const response = await this.github.searchIssueAndPullRequests({ query: this.query, maxResults: this.maxResults, }); + $.export("$summary", `Successfully fetched ${response.length} items`); + return response; }, }; From a9cb28a68d91e7d7f0c4699dedf654540648369b Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sat, 21 Sep 2024 21:12:40 -0300 Subject: [PATCH 05/29] "Create or Update file contents" improvements --- .../create-or-update-file-contents.mjs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs index 284c51753280d..044fc728a06c5 100644 --- a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs +++ b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs @@ -2,9 +2,9 @@ import github from "../../github.app.mjs"; export default { key: "github-create-or-update-file-contents", - name: "Create or update file contents", - description: "Create or update a file in a repository. This will replace an existing file. [See docs here](https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents)", - version: "0.0.13", + name: "Create or Update File Contents", + description: "Create or update a file in a repository. [See the documentation](https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents)", + version: "0.1.0", type: "action", props: { github, @@ -32,22 +32,23 @@ export default { default: "Pipedream - {{steps.trigger.context.workflow_name}} ({{steps.trigger.context.workflow_id}})", }, branch: { - label: "Branch", + propDefinition: [ + github, + "branch", + (c) => ({ + repoFullname: c.repoFullname, + }), + ], description: - "The branch name. Defaults to the repository’s default branch (usually `master`)", - type: "string", + "The branch to use. Defaults to the repository's default branch (usually `main` or `master`)", optional: true, }, }, async run({ $ }) { - - const response = await this.github.createOrUpdateFileContent({ - repoFullname: this.repoFullname, - path: this.path, - commitMessage: this.commitMessage, - fileContent: this.fileContent, - branch: this.branch, - }); + const { + github, ...data + } = this; + const response = await github.createOrUpdateFileContent(data); $.export("$summary", `Successfully set contents of ${this.path}${this.branch ? ` on branch ${this.branch}` From 91229399d535bff951e5913d37a203bc0736ba81 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sat, 21 Sep 2024 23:08:34 -0300 Subject: [PATCH 06/29] Get Repository Contents adjustments --- .../get-repository-content.mjs | 51 ++++++++++++------- components/github/github.app.mjs | 2 + 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/components/github/actions/get-repository-content/get-repository-content.mjs b/components/github/actions/get-repository-content/get-repository-content.mjs index b63c55b6dcba2..63d0c493b9f84 100644 --- a/components/github/actions/get-repository-content/get-repository-content.mjs +++ b/components/github/actions/get-repository-content/get-repository-content.mjs @@ -1,14 +1,10 @@ -import { toSingleLineString } from "../../common/utils.mjs"; import github from "../../github.app.mjs"; export default { key: "github-get-repository-content", name: "Get Repository Content", - description: toSingleLineString(` - Get the content of a file or directory in a specific repository. - [See docs here](https://docs.github.com/en/rest/repos/contents#get-repository-content) - `), - version: "0.0.16", + description: "Get the content of a file or directory in a specific repository. [See the documentation](https://docs.github.com/en/rest/repos/contents#get-repository-content)", + version: "0.1.0", type: "action", props: { github, @@ -20,25 +16,41 @@ export default { }, path: { label: "Path", - description: toSingleLineString(` - The file path or directory to retrieve. - When left unspecified, this action will retrieve the contents of the - repository's root directory. - `), + description: "The file path or directory to retrieve. Defaults to the repository's root directory.", type: "string", default: "", optional: true, }, mediaType: { label: "Media Type", - description: toSingleLineString(` - [Custom media types](https://docs.github.com/en/rest/overview/media-types) are used in the API to let consumers choose the format of the data they wish to receive. - This is done by adding one or more of the following types to the Accept header when you make a request. - Media types are specific to resources, allowing them to change independently and support - formats that other resources don't. - `), + description: "The media type of the response. [See the documentation](https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content) for more information.", type: "string", - default: "", + options: [ + { + value: "application/vnd.github.raw+json", + label: "Returns the raw file contents for files and symlinks", + }, + { + value: "application/vnd.github.html+json", + label: "Returns the file contents in HTML", + }, + { + value: "application/vnd.github.object+json", + label: "Returns the contents in a consistent object format regardless of the content type", + }, + ], + optional: true, + }, + branch: { + propDefinition: [ + github, + "branch", + (c) => ({ + repoFullname: c.repoFullname, + }), + ], + description: + "The branch to use. Defaults to the repository's default branch (usually `main` or `master`)", optional: true, }, }, @@ -47,6 +59,9 @@ export default { repoFullname: this.repoFullname, path: this.path, mediaType: this.mediaType, + params: { + ref: this.branch, + }, }); $.export("$summary", "Successfully retrieved repository content."); diff --git a/components/github/github.app.mjs b/components/github/github.app.mjs index cf9f99e96694b..eacc875d880f4 100644 --- a/components/github/github.app.mjs +++ b/components/github/github.app.mjs @@ -351,6 +351,7 @@ export default { repoFullname, path, mediaType, + ...args }) { return this._makeRequest({ path: `/repos/${repoFullname}/contents/${path}`, @@ -359,6 +360,7 @@ export default { Accept: mediaType, }, }), + ...args, }); }, async getRepositoryLabels({ repoFullname }) { From fa3baa6c784f6d47c02ef0dba8844b51c2459a96 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sat, 21 Sep 2024 23:52:03 -0300 Subject: [PATCH 07/29] Create Branch text adjustments --- components/github/actions/create-branch/create-branch.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/github/actions/create-branch/create-branch.mjs b/components/github/actions/create-branch/create-branch.mjs index 4225e953de687..4433774a56934 100644 --- a/components/github/actions/create-branch/create-branch.mjs +++ b/components/github/actions/create-branch/create-branch.mjs @@ -4,8 +4,8 @@ import github from "../../github.app.mjs"; export default { key: "github-create-branch", name: "Create Branch", - description: "Create a new branch in a Github repo. [See docs here](https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#create-a-reference)", - version: "0.0.12", + description: "Create a new branch in a Github repo. [See the documentation](https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#create-a-reference)", + version: "0.0.13", type: "action", props: { github, @@ -22,7 +22,7 @@ export default { }, branchSha: { label: "Source Branch", - description: "The source branch that will be used to create the new branch", + description: "The source branch that will be used to create the new branch. Defaults to the repository's default branch (usually `main` or `master`", propDefinition: [ github, "branch", From 5e468d26ea60636831c9dba6e9e1af34784403b4 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sun, 22 Sep 2024 20:08:56 -0300 Subject: [PATCH 08/29] Text updates --- components/github/actions/create-gist/create-gist.mjs | 2 +- .../actions/create-issue-comment/create-issue-comment.mjs | 2 +- .../github/actions/create-pull-request/create-pull-request.mjs | 2 +- .../github/actions/create-repository/create-repository.mjs | 2 +- .../github/actions/get-issue-assignees/get-issue-assignees.mjs | 2 +- .../actions/list-gists-for-a-user/list-gists-for-a-user.mjs | 2 +- components/github/actions/update-gist/update-gist.mjs | 2 +- components/github/actions/update-issue/update-issue.mjs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/github/actions/create-gist/create-gist.mjs b/components/github/actions/create-gist/create-gist.mjs index 0a180f3141589..995b4b07fee65 100644 --- a/components/github/actions/create-gist/create-gist.mjs +++ b/components/github/actions/create-gist/create-gist.mjs @@ -4,7 +4,7 @@ import utils from "../../actions/common/utils.mjs"; export default { key: "github-create-gist", name: "Create Gist", - description: "Allows you to add a new gist with one or more files. [See docs here](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#create-a-gist)", + description: "Allows you to add a new gist with one or more files. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#create-a-gist)", version: "0.0.6", type: "action", props: { diff --git a/components/github/actions/create-issue-comment/create-issue-comment.mjs b/components/github/actions/create-issue-comment/create-issue-comment.mjs index ead0c44dc6e11..8a70346c243e9 100644 --- a/components/github/actions/create-issue-comment/create-issue-comment.mjs +++ b/components/github/actions/create-issue-comment/create-issue-comment.mjs @@ -3,7 +3,7 @@ import github from "../../github.app.mjs"; export default { key: "github-create-issue-comment", name: "Create Issue Comment", - description: "Create a new comment in a issue. [See docs here](https://docs.github.com/en/rest/issues/comments#create-an-issue-comment)", + description: "Create a new comment in a issue. [See the documentation](https://docs.github.com/en/rest/issues/comments#create-an-issue-comment)", version: "0.0.17", type: "action", props: { diff --git a/components/github/actions/create-pull-request/create-pull-request.mjs b/components/github/actions/create-pull-request/create-pull-request.mjs index 79f54d7ee28d8..1e59a60d195c0 100644 --- a/components/github/actions/create-pull-request/create-pull-request.mjs +++ b/components/github/actions/create-pull-request/create-pull-request.mjs @@ -7,7 +7,7 @@ export default { name: "Create Pull Request", description: toSingleLineString(` Creates a new pull request for a specified repository. - [See docs here](https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request) + [See the documentation](https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request) `), version: "0.0.9", type: "action", diff --git a/components/github/actions/create-repository/create-repository.mjs b/components/github/actions/create-repository/create-repository.mjs index 622a9451a0b1f..6ab457681dd5e 100644 --- a/components/github/actions/create-repository/create-repository.mjs +++ b/components/github/actions/create-repository/create-repository.mjs @@ -3,7 +3,7 @@ import github from "../../github.app.mjs"; export default { key: "github-create-repository", name: "Create Repository", - description: "Creates a new repository for the authenticated user. [See docs here](https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user)", + description: "Creates a new repository for the authenticated user. [See the documentation](https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user)", version: "0.0.12", type: "action", props: { diff --git a/components/github/actions/get-issue-assignees/get-issue-assignees.mjs b/components/github/actions/get-issue-assignees/get-issue-assignees.mjs index b89734118a8c5..5ebd8ba571d7f 100644 --- a/components/github/actions/get-issue-assignees/get-issue-assignees.mjs +++ b/components/github/actions/get-issue-assignees/get-issue-assignees.mjs @@ -3,7 +3,7 @@ import github from "../../github.app.mjs"; export default { key: "github-get-issue-assignees", name: "Get Issue Assignees", - description: "Get assignees for an issue in a Gihub repo. [See docs here](https://docs.github.com/en/rest/issues/issues#get-an-issue)", + description: "Get assignees for an issue in a Gihub repo. [See the documentation](https://docs.github.com/en/rest/issues/issues#get-an-issue)", version: "0.0.17", type: "action", props: { diff --git a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs index beef31888d9f1..17545dfd03e38 100644 --- a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs +++ b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs @@ -3,7 +3,7 @@ import github from "../../github.app.mjs"; export default { key: "github-list-gists-for-a-user", name: "List Gists for a User", - description: "Lists public gists for the specified user. [See docs here](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-a-user)", + description: "Lists public gists for the specified user. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-a-user)", version: "0.0.6", type: "action", props: { diff --git a/components/github/actions/update-gist/update-gist.mjs b/components/github/actions/update-gist/update-gist.mjs index e7491a0d6a4e5..f1c3f9d2bfabe 100644 --- a/components/github/actions/update-gist/update-gist.mjs +++ b/components/github/actions/update-gist/update-gist.mjs @@ -5,7 +5,7 @@ import { ConfigurationError } from "@pipedream/platform"; export default { key: "github-update-gist", name: "Update Gist", - description: "Allows you to update a gist's description and to update, delete, or rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. At least one of description or files is required. [See docs here](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#update-a-gist)", + description: "Allows you to update a gist's description and to update, delete, or rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. At least one of description or files is required. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#update-a-gist)", version: "0.0.6", type: "action", props: { diff --git a/components/github/actions/update-issue/update-issue.mjs b/components/github/actions/update-issue/update-issue.mjs index d9062ed8b6850..e8ebdb0c0f3d2 100644 --- a/components/github/actions/update-issue/update-issue.mjs +++ b/components/github/actions/update-issue/update-issue.mjs @@ -3,7 +3,7 @@ import github from "../../github.app.mjs"; export default { key: "github-update-issue", name: "Update Issue", - description: "Update a new issue in a Gihub repo. [See docs here](https://docs.github.com/en/rest/issues/issues#update-an-issue)", + description: "Update a new issue in a Gihub repo. [See the documentation](https://docs.github.com/en/rest/issues/issues#update-an-issue)", version: "0.1.16", type: "action", props: { From cc12ab8e36d85c4cc8c69185d820853912489d9f Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sun, 22 Sep 2024 21:17:16 -0300 Subject: [PATCH 09/29] Adding pagination to issues --- components/github/github.app.mjs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/github/github.app.mjs b/components/github/github.app.mjs index eacc875d880f4..8aadb392ec0de 100644 --- a/components/github/github.app.mjs +++ b/components/github/github.app.mjs @@ -162,8 +162,11 @@ export default { label: "Issue Number", description: "The issue number", type: "integer", - async options({ repoFullname }) { + async options({ + repoFullname, page = 0, + }) { const issues = await this.getRepositoryIssues({ + page: page + 1, repoFullname, }); @@ -369,10 +372,14 @@ export default { async getRepositoryCollaborators({ repoFullname }) { return this._client().paginate(`GET /repos/${repoFullname}/collaborators`, {}); }, - async getRepositoryIssues({ repoFullname }) { - return this._client().paginate(`GET /repos/${repoFullname}/issues`, { + async getRepositoryIssues({ + repoFullname, ...args + }) { + const results = await this._client().request(`GET /repos/${repoFullname}/issues`, { state: "all", + ...args, }); + return results.data; }, async getRepositoryProjects({ repoFullname }) { return this._client().paginate(`GET /repos/${repoFullname}/projects`, {}); From b17eeace342281591ea0a33e53893aac622bd35f Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Sun, 22 Sep 2024 21:44:00 -0300 Subject: [PATCH 10/29] Update Issue adjustments --- .../actions/create-issue/create-issue.mjs | 1 - .../actions/update-issue/update-issue.mjs | 69 +++++-------------- 2 files changed, 18 insertions(+), 52 deletions(-) diff --git a/components/github/actions/create-issue/create-issue.mjs b/components/github/actions/create-issue/create-issue.mjs index 72581fe62d7e0..13ed4d96e68f9 100644 --- a/components/github/actions/create-issue/create-issue.mjs +++ b/components/github/actions/create-issue/create-issue.mjs @@ -34,7 +34,6 @@ export default { }, async additionalProps() { const canPush = await this.checkPushPermission(); - console.log("canPush", canPush); return canPush ? { assignees: asyncProps.assignees, diff --git a/components/github/actions/update-issue/update-issue.mjs b/components/github/actions/update-issue/update-issue.mjs index e8ebdb0c0f3d2..2aaf16f27bea2 100644 --- a/components/github/actions/update-issue/update-issue.mjs +++ b/components/github/actions/update-issue/update-issue.mjs @@ -1,4 +1,10 @@ -import github from "../../github.app.mjs"; +import createIssue from "../create-issue/create-issue.mjs"; + +const { + props: { + github, repoFullname, ...props + }, additionalProps, methods, +} = createIssue; export default { key: "github-update-issue", @@ -8,12 +14,7 @@ export default { type: "action", props: { github, - repoFullname: { - propDefinition: [ - github, - "repoFullname", - ], - }, + repoFullname, issueNumber: { label: "Issue Number", description: "The number that identifies the issue.", @@ -26,55 +27,21 @@ export default { }), ], }, - title: { - label: "Title", - description: "The title of the issue", - type: "string", - }, - body: { - label: "Body", - description: "The contents of the issue", - type: "string", - optional: true, - }, - labels: { - label: "Labels", - description: "Labels to associate with this issue. NOTE: Only users with push access can set labels for new issues", - optional: true, - propDefinition: [ - github, - "labels", - (c) => ({ - repoFullname: c.repoFullname, - }), - ], - }, - assignees: { - label: "Assignees", - description: "Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues", - optional: true, - propDefinition: [ - github, - "collaborators", - (c) => ({ - repoFullname: c.repoFullname, - }), - ], - }, + ...props, }, + additionalProps, + methods, async run({ $ }) { + const { // eslint-disable-next-line no-unused-vars + github, repoFullname, issueNumber, infoBox, ...data + } = this; const response = await this.github.updateIssue({ - repoFullname: this.repoFullname, - issueNumber: this.issueNumber, - data: { - title: this.title, - body: this.body, - labels: this.labels, - assignees: this.assignees, - }, + repoFullname, + issueNumber, + data, }); - $.export("$summary", "Successfully created issue."); + $.export("$summary", `Successfully updated issue #${issueNumber}`); return response; }, From 763bdeb72a8a621da50cef9f4d296ae32601cb90 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 23 Sep 2024 02:29:17 -0300 Subject: [PATCH 11/29] Get Reviewers + adjustments --- .../github/actions/common/asyncProps.mjs | 16 +++++++ .../actions/get-reviewers/get-reviewers.mjs | 47 ++++++++++--------- components/github/github.app.mjs | 12 +++-- 3 files changed, 50 insertions(+), 25 deletions(-) diff --git a/components/github/actions/common/asyncProps.mjs b/components/github/actions/common/asyncProps.mjs index 9b1bee33e7e7d..178bf3e5f1734 100644 --- a/components/github/actions/common/asyncProps.mjs +++ b/components/github/actions/common/asyncProps.mjs @@ -41,4 +41,20 @@ export default { })); }, }, + pullNumber: { + type: "integer", + label: "Pull Request Number", + description: "The pull request to get reviewers for", + options: async ({ page }) => { + const prs = await this.github.getRepositoryPullRequests({ + page: page + 1, + repoFullname: this.repoFullname, + }); + + return prs.map((pr) => ({ + label: pr.title, + value: +pr.number, + })); + }, + }, }; diff --git a/components/github/actions/get-reviewers/get-reviewers.mjs b/components/github/actions/get-reviewers/get-reviewers.mjs index b1780acf772d3..a5be8ef888a9e 100644 --- a/components/github/actions/get-reviewers/get-reviewers.mjs +++ b/components/github/actions/get-reviewers/get-reviewers.mjs @@ -1,12 +1,12 @@ import github from "../../github.app.mjs"; +import asyncProps from "../common/asyncProps.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.17", + description: "Get reviewers for a PR ([see documentation](https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request)) or Commit SHA ([see documentation](https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit)).", + version: "0.1.{{ts}}", type: "action", props: { github, @@ -16,21 +16,15 @@ export default { "repoFullname", ], }, - pullNumber: { - propDefinition: [ - github, - "pullNumber", - (c) => ({ - repoFullname: c.repoFullname, - }), - ], - optional: true, - }, - commitSha: { + prOrCommit: { type: "string", - label: "Commit SHA", - description: "A commit SHA. This field will have precendence over **PR Number**", - optional: true, + label: "PR or Commit", + description: "Whether to get reviewers for a [pull request](https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request) or a [commit SHA](https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit).", + options: [ + "Pull Request", + "Commit SHA", + ], + reloadProps: true, }, reviewStates: { type: "string[]", @@ -40,6 +34,19 @@ export default { optional: true, }, }, + async additionalProps() { + return this.prOrCommit === "Pull Request" + ? { + pullNumber: asyncProps.pullNumber, + } + : { + commitSha: { + type: "string", + label: "Commit SHA", + description: "A commit SHA to get reviewers for", + }, + }; + }, methods: { getReviewers(reviews) { const reviewers = reviews @@ -62,10 +69,6 @@ export default { }, }, 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) { @@ -89,7 +92,7 @@ export default { const reviewers = this.getReviewers(reviews); - $.export("$summary", "Successfully retrieved reviewers."); + $.export("$summary", "Successfully retrieved reviewers"); return reviewers; }, diff --git a/components/github/github.app.mjs b/components/github/github.app.mjs index 8aadb392ec0de..ca2eeb5faa421 100644 --- a/components/github/github.app.mjs +++ b/components/github/github.app.mjs @@ -198,8 +198,11 @@ export default { type: "integer", label: "PR Number", description: "A pull request number", - async options({ repoFullname }) { + async options({ + repoFullname, page = 0, + }) { const prs = await this.getRepositoryPullRequests({ + page: page + 1, repoFullname, }); @@ -573,8 +576,11 @@ export default { return issues; }, - async getRepositoryPullRequests({ repoFullname }) { - return this._client().paginate(`GET /repos/${repoFullname}/pulls`, {}); + async getRepositoryPullRequests({ + repoFullname, ...args + }) { + const response = await this._client().request(`GET /repos/${repoFullname}/pulls`, args ?? {}); + return response.data; }, async getPullRequestForCommit({ repoFullname, sha, From 225921bcec883facdfe1da751fe2829a4d8a62f2 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 23 Sep 2024 02:39:24 -0300 Subject: [PATCH 12/29] List Gists and Update Gist updates --- .../list-gists-for-a-user.mjs | 35 ++++++++++++++----- .../actions/update-gist/update-gist.mjs | 7 +++- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs index 17545dfd03e38..51ee834efd677 100644 --- a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs +++ b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs @@ -1,34 +1,51 @@ +import { ConfigurationError } from "@pipedream/platform"; import github from "../../github.app.mjs"; export default { key: "github-list-gists-for-a-user", name: "List Gists for a User", description: "Lists public gists for the specified user. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-a-user)", - version: "0.0.6", + version: "0.1.{{ts}}", type: "action", props: { - github, - username: { - label: "Username", - description: "The username of the user whose gists you want to list", - type: "string", + github: { + ...github, + reloadProps: true, }, since: { - label: "Since", - description: "Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.", + label: "Filter by Timestamp", + description: "Only show notifications updated since the given time. This should be a timestamp in ISO 8601 format, e.g. `2018-05-16T09:30:10Z` or [another standard date/time format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format).", type: "string", optional: true, }, }, + async additionalProps() { + const { login } = await this.github.getAuthenticatedUser(); + return { + username: { + label: "Username", + description: "The username of the user whose gists you want to list", + type: "string", + default: login, + }, + }; + }, async run({ $ }) { const PER_PAGE = 100; const MAX_PAGES = 50; let page = 1; const data = []; + const date = new Date(this.since); + if (isNaN(date.getTime())) { + throw new ConfigurationError("Invalid date string provided"); + } + + const since = date.toISOString(); + while (true) { const res = await this.github.listGistsFromUser(this.username, { - since: this.since, + since, per_page: PER_PAGE, page, }); diff --git a/components/github/actions/update-gist/update-gist.mjs b/components/github/actions/update-gist/update-gist.mjs index f1c3f9d2bfabe..31576feab216a 100644 --- a/components/github/actions/update-gist/update-gist.mjs +++ b/components/github/actions/update-gist/update-gist.mjs @@ -5,11 +5,16 @@ import { ConfigurationError } from "@pipedream/platform"; export default { key: "github-update-gist", name: "Update Gist", - description: "Allows you to update a gist's description and to update, delete, or rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. At least one of description or files is required. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#update-a-gist)", + description: "Allows you to update a gist's description and to update, delete, or rename gist files. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#update-a-gist)", version: "0.0.6", type: "action", props: { github, + infoAlert: { + type: "alert", + alertType: "info", + content: "Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. At least one of description or files is required.", + }, gistId: { propDefinition: [ github, From bf91b7ce3b53c5c7bc673798c0d4a52b9b4f0009 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 23 Sep 2024 10:45:59 -0300 Subject: [PATCH 13/29] Create Pull Request improvements --- .../create-pull-request.mjs | 72 ++++++------------- components/github/common/utils.mjs | 23 ------ 2 files changed, 20 insertions(+), 75 deletions(-) diff --git a/components/github/actions/create-pull-request/create-pull-request.mjs b/components/github/actions/create-pull-request/create-pull-request.mjs index 1e59a60d195c0..090854a08409b 100644 --- a/components/github/actions/create-pull-request/create-pull-request.mjs +++ b/components/github/actions/create-pull-request/create-pull-request.mjs @@ -1,15 +1,11 @@ import { ConfigurationError } from "@pipedream/platform"; -import { toSingleLineString } from "../../common/utils.mjs"; import github from "../../github.app.mjs"; export default { key: "github-create-pull-request", name: "Create Pull Request", - description: toSingleLineString(` - Creates a new pull request for a specified repository. - [See the documentation](https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request) - `), - version: "0.0.9", + description: "Creates a new pull request for a specified repository. [See the documentation](https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request)", + version: "0.1.{{ts}}", type: "action", props: { github, @@ -18,20 +14,8 @@ export default { github, "repoFullname", ], - }, - head: { - propDefinition: [ - github, - "branch", - (c) => ({ - repoFullname: c.repoFullname, - }), - ], - label: "Head Branch", - description: toSingleLineString(` - The name of the branch where your changes are implemented. - For cross-repository pull requests in the same network, \`namespace\` head with a user like this: \`username:branch\`. - `), + label: "Base Repository", + description: "The base repository, where the pull request will be created.", }, base: { propDefinition: [ @@ -42,58 +26,48 @@ export default { }), ], label: "Base Branch", - description: toSingleLineString(` - The name of the branch you want the changes pulled into. - This should be an existing branch on the current repository. - You cannot submit a pull request to one repository that requests a merge to a base of another repository. - `), + description: "The base branch, where the changes will be received.", }, - org: { + headRepo: { propDefinition: [ github, - "orgName", + "repoFullname", ], - optional: true, + label: "Head Repository", + description: "The head repository, where the changes originate from. This can, but does not have to, be the same repository.", }, - headRepo: { + head: { propDefinition: [ github, - "repoOrg", + "branch", (c) => ({ - org: c.org, + repoFullname: c.headRepo, }), ], - label: "Head Repository's Name", - description: toSingleLineString(` - The name of the repository where the changes in the pull request were made. - This field is required for cross-repository pull requests if both repositories are owned by the same organization. - `), - optional: true, + label: "Head Branch", + description: "The head branch, where the changes originate from", }, body: { label: "Body", - description: "The contents of the pull request.", + description: "The text description of the pull request.", type: "string", optional: true, }, maintainerCanModify: { - label: "Maintainer Can Modify", + label: "Maintainers Can Modify", description: "Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request.", type: "boolean", optional: true, }, draft: { label: "Is Draft", - description: toSingleLineString(` - Indicates whether the pull request is a draft. - See "[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. - `), + description: "Indicates whether the pull request is a draft. See \"[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)\" in the GitHub Help documentation to learn more.", type: "boolean", optional: true, }, title: { label: "Title", - description: "The title of the new pull request.", + description: "The title of the pull request.", type: "string", optional: true, }, @@ -106,10 +80,7 @@ export default { }), ], label: "Issue", - description: toSingleLineString(` - An issue in the repository to convert to a pull request. - The issue title, body, and comments will become the title, body, and comments on the new pull request. - `), + description: "An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request.", min: 1, optional: true, }, @@ -117,10 +88,7 @@ export default { async run({ $ }) { if (!this.issue && !this.title) { - throw new ConfigurationError(toSingleLineString(` - Title is required if Issue is unspecified. - You can either specify a new pull request with Title or convert an existing issue to a pull request with Issue. - `)); + throw new ConfigurationError("Title is required if Issue is unspecified. You can either specify a new pull request with Title or convert an existing issue to a pull request with Issue."); } if (this.issue && this.title) { diff --git a/components/github/common/utils.mjs b/components/github/common/utils.mjs index a57a5895fc9b0..aa4395d22455a 100644 --- a/components/github/common/utils.mjs +++ b/components/github/common/utils.mjs @@ -1,26 +1,3 @@ -/** - * A utility function that accepts a string as an argument and reformats it in - * order to remove newline characters and consecutive spaces. Useful when - * dealing with very long templated strings that are split into multiple lines. - * - * @example - * // returns "This is a much cleaner string" - * toSingleLineString(` - * This is a much - * cleaner string - * `); - * - * @param {string} multiLineString the input string to reformat - * @returns a formatted string based on the content of the input argument, - * without newlines and multiple spaces - */ -export function toSingleLineString(multiLineString) { - return multiLineString - .trim() - .replace(/\n/g, " ") - .replace(/\s{2,}/g, " "); -} - async function getUserRepoPermissions(github, repoFullname) { const { login: username } = await github.getAuthenticatedUser(); const { user: { permissions } } = await github.getUserRepoPermissions({ From 2bf2abc7623ad452aadc399837fdcbae70cac992 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 23 Sep 2024 10:54:15 -0300 Subject: [PATCH 14/29] Version bumps --- components/github/actions/create-gist/create-gist.mjs | 2 +- .../actions/create-issue-comment/create-issue-comment.mjs | 2 +- components/github/actions/create-issue/create-issue.mjs | 2 +- .../actions/create-pull-request/create-pull-request.mjs | 2 +- .../github/actions/create-repository/create-repository.mjs | 2 +- .../actions/get-issue-assignees/get-issue-assignees.mjs | 2 +- components/github/actions/get-reviewers/get-reviewers.mjs | 2 +- .../actions/list-gists-for-a-user/list-gists-for-a-user.mjs | 2 +- components/github/actions/list-releases/list-releases.mjs | 4 +--- .../search-issues-and-pull-requests.mjs | 2 +- components/github/actions/update-gist/update-gist.mjs | 2 +- components/github/actions/update-issue/update-issue.mjs | 2 +- .../update-project-v2-item-status.mjs | 2 +- 13 files changed, 13 insertions(+), 15 deletions(-) diff --git a/components/github/actions/create-gist/create-gist.mjs b/components/github/actions/create-gist/create-gist.mjs index 995b4b07fee65..8bd85c019a05f 100644 --- a/components/github/actions/create-gist/create-gist.mjs +++ b/components/github/actions/create-gist/create-gist.mjs @@ -5,7 +5,7 @@ export default { key: "github-create-gist", name: "Create Gist", description: "Allows you to add a new gist with one or more files. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#create-a-gist)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { github, diff --git a/components/github/actions/create-issue-comment/create-issue-comment.mjs b/components/github/actions/create-issue-comment/create-issue-comment.mjs index 8a70346c243e9..a455eac68b53d 100644 --- a/components/github/actions/create-issue-comment/create-issue-comment.mjs +++ b/components/github/actions/create-issue-comment/create-issue-comment.mjs @@ -4,7 +4,7 @@ export default { key: "github-create-issue-comment", name: "Create Issue Comment", description: "Create a new comment in a issue. [See the documentation](https://docs.github.com/en/rest/issues/comments#create-an-issue-comment)", - version: "0.0.17", + version: "0.0.18", type: "action", props: { github, diff --git a/components/github/actions/create-issue/create-issue.mjs b/components/github/actions/create-issue/create-issue.mjs index 13ed4d96e68f9..c146d827b3d22 100644 --- a/components/github/actions/create-issue/create-issue.mjs +++ b/components/github/actions/create-issue/create-issue.mjs @@ -6,7 +6,7 @@ export default { key: "github-create-issue", name: "Create Issue", description: "Create a new issue in a Gihub repo. [See the documentation](https://docs.github.com/en/rest/issues/issues#create-an-issue)", - version: "0.3.{{ts}}", + version: "0.3.0", type: "action", props: { github, diff --git a/components/github/actions/create-pull-request/create-pull-request.mjs b/components/github/actions/create-pull-request/create-pull-request.mjs index 090854a08409b..c6f9881e2fe0b 100644 --- a/components/github/actions/create-pull-request/create-pull-request.mjs +++ b/components/github/actions/create-pull-request/create-pull-request.mjs @@ -5,7 +5,7 @@ export default { key: "github-create-pull-request", name: "Create Pull Request", description: "Creates a new pull request for a specified repository. [See the documentation](https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request)", - version: "0.1.{{ts}}", + version: "0.1.0", type: "action", props: { github, diff --git a/components/github/actions/create-repository/create-repository.mjs b/components/github/actions/create-repository/create-repository.mjs index 6ab457681dd5e..2bad7e7a73f84 100644 --- a/components/github/actions/create-repository/create-repository.mjs +++ b/components/github/actions/create-repository/create-repository.mjs @@ -4,7 +4,7 @@ export default { key: "github-create-repository", name: "Create Repository", description: "Creates a new repository for the authenticated user. [See the documentation](https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user)", - version: "0.0.12", + version: "0.0.13", type: "action", props: { github, diff --git a/components/github/actions/get-issue-assignees/get-issue-assignees.mjs b/components/github/actions/get-issue-assignees/get-issue-assignees.mjs index 5ebd8ba571d7f..ba325f4cd8a61 100644 --- a/components/github/actions/get-issue-assignees/get-issue-assignees.mjs +++ b/components/github/actions/get-issue-assignees/get-issue-assignees.mjs @@ -4,7 +4,7 @@ export default { key: "github-get-issue-assignees", name: "Get Issue Assignees", description: "Get assignees for an issue in a Gihub repo. [See the documentation](https://docs.github.com/en/rest/issues/issues#get-an-issue)", - version: "0.0.17", + version: "0.0.18", type: "action", props: { github, diff --git a/components/github/actions/get-reviewers/get-reviewers.mjs b/components/github/actions/get-reviewers/get-reviewers.mjs index a5be8ef888a9e..16f1b817f8e19 100644 --- a/components/github/actions/get-reviewers/get-reviewers.mjs +++ b/components/github/actions/get-reviewers/get-reviewers.mjs @@ -6,7 +6,7 @@ export default { key: "github-get-reviewers", name: "Get Reviewers", description: "Get reviewers for a PR ([see documentation](https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request)) or Commit SHA ([see documentation](https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit)).", - version: "0.1.{{ts}}", + version: "0.1.0", type: "action", props: { github, diff --git a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs index 51ee834efd677..05e8bec251411 100644 --- a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs +++ b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs @@ -5,7 +5,7 @@ export default { key: "github-list-gists-for-a-user", name: "List Gists for a User", description: "Lists public gists for the specified user. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-a-user)", - version: "0.1.{{ts}}", + version: "0.1.0", type: "action", props: { github: { diff --git a/components/github/actions/list-releases/list-releases.mjs b/components/github/actions/list-releases/list-releases.mjs index 4a2d41db7b766..b69c42e9c2bba 100644 --- a/components/github/actions/list-releases/list-releases.mjs +++ b/components/github/actions/list-releases/list-releases.mjs @@ -1,12 +1,10 @@ -// Import necessary modules import github from "../../github.app.mjs"; -// Define the action export default { key: "github-list-releases", name: "List Releases", description: "List releases for a repository [See the documentation](https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases)", - version: "0.0.5", + version: "0.0.6", type: "action", props: { github, diff --git a/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs b/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs index 26ffacfede4c8..8c1a77308d0e8 100644 --- a/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs +++ b/components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs @@ -4,7 +4,7 @@ export default { key: "github-search-issues-and-pull-requests", name: "Search Issues and Pull Requests", description: "Find issues and pull requests by state and keyword. [See the documentation](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests)", - version: "0.2.{{ts}}", + version: "0.2.0", type: "action", props: { github, diff --git a/components/github/actions/update-gist/update-gist.mjs b/components/github/actions/update-gist/update-gist.mjs index 31576feab216a..fd2d8b19ac57b 100644 --- a/components/github/actions/update-gist/update-gist.mjs +++ b/components/github/actions/update-gist/update-gist.mjs @@ -6,7 +6,7 @@ export default { key: "github-update-gist", name: "Update Gist", description: "Allows you to update a gist's description and to update, delete, or rename gist files. [See the documentation](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#update-a-gist)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { github, diff --git a/components/github/actions/update-issue/update-issue.mjs b/components/github/actions/update-issue/update-issue.mjs index 2aaf16f27bea2..6b8111959b750 100644 --- a/components/github/actions/update-issue/update-issue.mjs +++ b/components/github/actions/update-issue/update-issue.mjs @@ -10,7 +10,7 @@ export default { key: "github-update-issue", name: "Update Issue", description: "Update a new issue in a Gihub repo. [See the documentation](https://docs.github.com/en/rest/issues/issues#update-an-issue)", - version: "0.1.16", + version: "0.2.0", type: "action", props: { github, diff --git a/components/github/actions/update-project-v2-item-status/update-project-v2-item-status.mjs b/components/github/actions/update-project-v2-item-status/update-project-v2-item-status.mjs index e94374bfbcd5f..7aff1349e2116 100644 --- a/components/github/actions/update-project-v2-item-status/update-project-v2-item-status.mjs +++ b/components/github/actions/update-project-v2-item-status/update-project-v2-item-status.mjs @@ -4,7 +4,7 @@ export default { key: "github-update-project-v2-item-status", name: "Update Project (V2) Item Status", description: "Update the status of an item in the selected Project (V2). [See the documentation](https://docs.github.com/en/graphql/reference/mutations#updateprojectv2itemfieldvalue)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { github, From 2a6786a71be6018e210c863ddf17a913d4803333 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 23 Sep 2024 10:55:55 -0300 Subject: [PATCH 15/29] Version bumps --- components/github/package.json | 2 +- components/github/sources/new-branch/new-branch.mjs | 2 +- .../github/sources/new-card-in-column/new-card-in-column.mjs | 2 +- components/github/sources/new-collaborator/new-collaborator.mjs | 2 +- .../github/sources/new-commit-comment/new-commit-comment.mjs | 2 +- components/github/sources/new-commit/new-commit.mjs | 2 +- components/github/sources/new-discussion/new-discussion.mjs | 2 +- components/github/sources/new-fork/new-fork.mjs | 2 +- components/github/sources/new-gist/new-gist.mjs | 2 +- .../sources/new-issue-with-status/new-issue-with-status.mjs | 2 +- components/github/sources/new-label/new-label.mjs | 2 +- components/github/sources/new-mention/new-mention.mjs | 2 +- components/github/sources/new-notification/new-notification.mjs | 2 +- .../sources/new-or-updated-issue/new-or-updated-issue.mjs | 2 +- .../new-or-updated-milestone/new-or-updated-milestone.mjs | 2 +- .../new-or-updated-pull-request/new-or-updated-pull-request.mjs | 2 +- components/github/sources/new-organization/new-organization.mjs | 2 +- components/github/sources/new-release/new-release.mjs | 2 +- components/github/sources/new-repository/new-repository.mjs | 2 +- .../github/sources/new-review-request/new-review-request.mjs | 2 +- .../github/sources/new-security-alert/new-security-alert.mjs | 2 +- components/github/sources/new-star-by-user/new-star-by-user.mjs | 2 +- components/github/sources/new-star/new-star.mjs | 2 +- components/github/sources/new-team/new-team.mjs | 2 +- components/github/sources/webhook-events/webhook-events.mjs | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/components/github/package.json b/components/github/package.json index 9c9555b2c0a24..5329710a21a41 100644 --- a/components/github/package.json +++ b/components/github/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/github", - "version": "1.4.0", + "version": "1.5.0", "description": "Pipedream Github Components", "main": "github.app.mjs", "keywords": [ 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-gist/new-gist.mjs b/components/github/sources/new-gist/new-gist.mjs index 5d580c57640b8..197c35625ed2c 100644 --- a/components/github/sources/new-gist/new-gist.mjs +++ b/components/github/sources/new-gist/new-gist.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-gist", name: "New Gist", description: "Emit new events when new gists are created by the authenticated user. [See the documentatoion](https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", 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-mention/new-mention.mjs b/components/github/sources/new-mention/new-mention.mjs index 40c2e3939bc29..98c5457c54c6f 100644 --- a/components/github/sources/new-mention/new-mention.mjs +++ b/components/github/sources/new-mention/new-mention.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-mention", name: "New Mention", description: "Emit new event when you are @mentioned in a new commit, comment, issue or pull request. [See the documentation](https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#list-notifications-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-notification/new-notification.mjs b/components/github/sources/new-notification/new-notification.mjs index c5c3b579c52a7..1411bea450e59 100644 --- a/components/github/sources/new-notification/new-notification.mjs +++ b/components/github/sources/new-notification/new-notification.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-notification", name: "New Notification", description: "Emit new event when the authenticated user receives a new notification. [See the documentation](https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#list-notifications-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", 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-organization/new-organization.mjs b/components/github/sources/new-organization/new-organization.mjs index d1a79328906e8..c10cad683bf13 100644 --- a/components/github/sources/new-organization/new-organization.mjs +++ b/components/github/sources/new-organization/new-organization.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-organization", name: "New Organization", description: "Emit new event when the authenticated user is added to a new organization. [See the documentation](https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", 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-repository/new-repository.mjs b/components/github/sources/new-repository/new-repository.mjs index 70b01cf45089e..00a86fe9cd66e 100644 --- a/components/github/sources/new-repository/new-repository.mjs +++ b/components/github/sources/new-repository/new-repository.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-repository", name: "New Repository", description: "Emit new event when a new repository is created or when the authenticated user receives access. [See the documentation](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-review-request/new-review-request.mjs b/components/github/sources/new-review-request/new-review-request.mjs index e725cd6dc1555..a4ae8cbf4b331 100644 --- a/components/github/sources/new-review-request/new-review-request.mjs +++ b/components/github/sources/new-review-request/new-review-request.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-review-request", name: "New Review Request", description: "Emit new event for new review request notifications. [See the documentation](https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#list-notifications-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-security-alert/new-security-alert.mjs b/components/github/sources/new-security-alert/new-security-alert.mjs index e793c93378525..c56265ac1d30d 100644 --- a/components/github/sources/new-security-alert/new-security-alert.mjs +++ b/components/github/sources/new-security-alert/new-security-alert.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-security-alert", name: "New Security Alert", description: "Emit new event for security alert notifications. [See the documentation](https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#list-notifications-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", type: "source", dedupe: "unique", methods: { diff --git a/components/github/sources/new-star-by-user/new-star-by-user.mjs b/components/github/sources/new-star-by-user/new-star-by-user.mjs index 50fdf353d6ceb..775bb75b13c91 100644 --- a/components/github/sources/new-star-by-user/new-star-by-user.mjs +++ b/components/github/sources/new-star-by-user/new-star-by-user.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-star-by-user", name: "New Star By User", description: "Emit new events when the specified user stars a repository. [See the documentation](https://docs.github.com/en/rest/activity/starring?apiVersion=2022-11-28#list-repositories-starred-by-a-user)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", props: { 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/new-team/new-team.mjs b/components/github/sources/new-team/new-team.mjs index 5c36526a123fb..82b153e2f308e 100644 --- a/components/github/sources/new-team/new-team.mjs +++ b/components/github/sources/new-team/new-team.mjs @@ -5,7 +5,7 @@ export default { key: "github-new-team", name: "New Team", description: "Emit new event when the authenticated user is added to a new team. [See the documentation](https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#list-teams-for-the-authenticated-user)", - version: "0.2.0", + version: "0.2.1", 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..8524932f4411c 100644 --- a/components/github/sources/webhook-events/webhook-events.mjs +++ b/components/github/sources/webhook-events/webhook-events.mjs @@ -8,7 +8,7 @@ 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", props: { docsInfo: { type: "alert", From c93226b66ba1db31c40c844af2a013a03276a640 Mon Sep 17 00:00:00 2001 From: Leo Vu Date: Tue, 24 Sep 2024 08:43:51 +0700 Subject: [PATCH 16/29] Update components/github/actions/create-branch/create-branch.mjs --- components/github/actions/create-branch/create-branch.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/actions/create-branch/create-branch.mjs b/components/github/actions/create-branch/create-branch.mjs index 4433774a56934..481ec3116fad5 100644 --- a/components/github/actions/create-branch/create-branch.mjs +++ b/components/github/actions/create-branch/create-branch.mjs @@ -22,7 +22,7 @@ export default { }, branchSha: { label: "Source Branch", - description: "The source branch that will be used to create the new branch. Defaults to the repository's default branch (usually `main` or `master`", + description: "The source branch that will be used to create the new branch. Defaults to the repository's default branch (usually `main` or `master`)", propDefinition: [ github, "branch", From 7a183e3c819e7cd74160eff6723f81e98b7d1858 Mon Sep 17 00:00:00 2001 From: Leo Vu Date: Tue, 24 Sep 2024 09:21:33 +0700 Subject: [PATCH 17/29] Fix typos --- components/github/actions/create-branch/create-branch.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/actions/create-branch/create-branch.mjs b/components/github/actions/create-branch/create-branch.mjs index 481ec3116fad5..e3b97390b8e3e 100644 --- a/components/github/actions/create-branch/create-branch.mjs +++ b/components/github/actions/create-branch/create-branch.mjs @@ -17,7 +17,7 @@ export default { }, branchName: { label: "Branch Name", - description: "The name of the new branch that will be crated", + description: "The name of the new branch that will be created", type: "string", }, branchSha: { From 195f4cb44f5340a8224a62ac5c94857d9ea8dd8e Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 24 Sep 2024 20:07:05 -0300 Subject: [PATCH 18/29] Fixing 'create or update file contents' branch prop --- .../create-or-update-file-contents.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs index 044fc728a06c5..066545f513617 100644 --- a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs +++ b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs @@ -46,9 +46,14 @@ export default { }, async run({ $ }) { const { - github, ...data + github, branch, ...data } = this; - const response = await github.createOrUpdateFileContent(data); + const response = await github.createOrUpdateFileContent({ + data: { + ...data, + branch: branch?.split?.("/")[0], + }, + }); $.export("$summary", `Successfully set contents of ${this.path}${this.branch ? ` on branch ${this.branch}` From 72f72464f1007103d0af56edd8e285bd4b6c8eeb Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 24 Sep 2024 21:36:22 -0300 Subject: [PATCH 19/29] Filtering out PRs from issueNumber prop --- components/github/github.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/github.app.mjs b/components/github/github.app.mjs index ca2eeb5faa421..e4fbc76c643c5 100644 --- a/components/github/github.app.mjs +++ b/components/github/github.app.mjs @@ -170,7 +170,7 @@ export default { repoFullname, }); - return issues.map((issue) => ({ + return issues?.filter?.((issue) => !issue.pull_request).map((issue) => ({ label: issue.title, value: +issue.number, })); From ee80a7d8686bcb353c4bfb43515aa0cb470cc78f Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 24 Sep 2024 21:39:50 -0300 Subject: [PATCH 20/29] Adjusting branch on 'Get Repository Content' --- .../actions/get-repository-content/get-repository-content.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/actions/get-repository-content/get-repository-content.mjs b/components/github/actions/get-repository-content/get-repository-content.mjs index 63d0c493b9f84..71306516d49b1 100644 --- a/components/github/actions/get-repository-content/get-repository-content.mjs +++ b/components/github/actions/get-repository-content/get-repository-content.mjs @@ -60,7 +60,7 @@ export default { path: this.path, mediaType: this.mediaType, params: { - ref: this.branch, + ref: this.branch?.split?.("/")[0], }, }); From 6dfb7800d09a99e169ca781337f575df15413ecd Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Wed, 25 Sep 2024 01:22:59 -0300 Subject: [PATCH 21/29] Changing default review states to all --- components/github/actions/get-reviewers/get-reviewers.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/github/actions/get-reviewers/get-reviewers.mjs b/components/github/actions/get-reviewers/get-reviewers.mjs index 16f1b817f8e19..57feaf92e3ffd 100644 --- a/components/github/actions/get-reviewers/get-reviewers.mjs +++ b/components/github/actions/get-reviewers/get-reviewers.mjs @@ -54,10 +54,7 @@ export default { if (this.reviewStates?.length) { return this.reviewStates.includes(review.state); // user-defined states } - return [ - "APPROVED", - "CHANGES_REQUESTED", - ].includes(review.state); // default states + return true; // default states: all }) .map((review) => review.user.login); return this.uniqueReviewers(reviewers); From 5ecffdecc92c8b8b921f7e9b84ec49fb65bc4f87 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Wed, 25 Sep 2024 01:47:23 -0300 Subject: [PATCH 22/29] Fixing 'list gists for user' --- .../list-gists-for-a-user/list-gists-for-a-user.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs index 05e8bec251411..672b008bd7bfe 100644 --- a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs +++ b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs @@ -36,12 +36,12 @@ export default { let page = 1; const data = []; - const date = new Date(this.since); - if (isNaN(date.getTime())) { + const date = this.since && new Date(this.since); + if (date && isNaN(date.getTime())) { throw new ConfigurationError("Invalid date string provided"); } - const since = date.toISOString(); + const since = date?.toISOString(); while (true) { const res = await this.github.listGistsFromUser(this.username, { @@ -62,11 +62,11 @@ export default { } if (data.length === 0) { - $.export("$summary", `No gists found for user "${this.username}".`); + $.export("$summary", `No gists found for user "${this.username}"`); return; } - $.export("$summary", `Successfully fetched ${data.length} gist(s).`); + $.export("$summary", `Successfully fetched ${data.length} gist(s)`); return data; }, }; From 6e41e4798a7695407adf76695d92e52fca21e213 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Wed, 25 Sep 2024 01:49:14 -0300 Subject: [PATCH 23/29] Fix --- .../actions/list-gists-for-a-user/list-gists-for-a-user.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs index 672b008bd7bfe..1fb82712793b2 100644 --- a/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs +++ b/components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs @@ -37,7 +37,7 @@ export default { const data = []; const date = this.since && new Date(this.since); - if (date && isNaN(date.getTime())) { + if (date && isNaN(date.valueOf())) { throw new ConfigurationError("Invalid date string provided"); } From e0994c9d25b5495046355fc66257ba0a29c54c64 Mon Sep 17 00:00:00 2001 From: Leo Vu Date: Wed, 25 Sep 2024 13:37:47 +0700 Subject: [PATCH 24/29] Improve reviewStates prop description --- components/github/actions/get-reviewers/get-reviewers.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/actions/get-reviewers/get-reviewers.mjs b/components/github/actions/get-reviewers/get-reviewers.mjs index 57feaf92e3ffd..237fa7fe4652b 100644 --- a/components/github/actions/get-reviewers/get-reviewers.mjs +++ b/components/github/actions/get-reviewers/get-reviewers.mjs @@ -29,7 +29,7 @@ export default { reviewStates: { type: "string[]", label: "Review States", - description: "Filter by these review states. Default includes `APPROVED` and `CHANGES_REQUESTED` only", + description: "Filter by these review states", options: constants.PULL_REQUEST_STATES, optional: true, }, From 962d6223299a3dd37fc72c49795020682e967fad Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Wed, 25 Sep 2024 17:29:59 -0300 Subject: [PATCH 25/29] Fixing syntax error in 'create or update file contents' --- .../create-or-update-file-contents.mjs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs index 066545f513617..1d9e82c0ad949 100644 --- a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs +++ b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs @@ -49,10 +49,8 @@ export default { github, branch, ...data } = this; const response = await github.createOrUpdateFileContent({ - data: { - ...data, - branch: branch?.split?.("/")[0], - }, + ...data, + branch: branch && branch.split("/")[0], }); $.export("$summary", `Successfully set contents of ${this.path}${this.branch From abfd83df13786c99aaf1f4792bf79c82d90b6cf7 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Thu, 26 Sep 2024 02:30:16 -0300 Subject: [PATCH 26/29] Adjusting branch name syntax --- .../create-or-update-file-contents.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs index 1d9e82c0ad949..61e8a08b5768f 100644 --- a/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs +++ b/components/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjs @@ -50,7 +50,7 @@ export default { } = this; const response = await github.createOrUpdateFileContent({ ...data, - branch: branch && branch.split("/")[0], + branch: branch && branch.split("/")[1], }); $.export("$summary", `Successfully set contents of ${this.path}${this.branch From b88c1b5904da4b478c4af7a13b8629c7a4f00686 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Thu, 26 Sep 2024 20:04:32 -0300 Subject: [PATCH 27/29] Fix: including branch when fetching file SHA --- components/github/github.app.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/github/github.app.mjs b/components/github/github.app.mjs index e4fbc76c643c5..3c57520b261a3 100644 --- a/components/github/github.app.mjs +++ b/components/github/github.app.mjs @@ -634,6 +634,11 @@ export default { const fileExists = await this._makeRequest({ path: `/repos/${repoFullname}/contents/${path}`, validateStatus: () => true, + ...(branch && { + params: { + ref: branch, + }, + }), }); if (fileExists.sha) { console.log("File exists, overwriting."); From cce2b03c7a0b9bb92ceae6c5f6f73125a481e2db Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Fri, 27 Sep 2024 14:52:23 -0300 Subject: [PATCH 28/29] Version bump --- components/github/sources/webhook-events/webhook-events.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/github/sources/webhook-events/webhook-events.mjs b/components/github/sources/webhook-events/webhook-events.mjs index fc6787ef705c0..9dd49e0f51160 100644 --- a/components/github/sources/webhook-events/webhook-events.mjs +++ b/components/github/sources/webhook-events/webhook-events.mjs @@ -8,7 +8,7 @@ export default { name: "New Webhook Event (Instant)", description: "Emit new event for each selected event type", type: "source", - version: "1.0.6", + version: "1.0.7", dedupe: "unique", props: { docsInfo: { From c08842a2b5617291f30ad9489957cf6659cea253 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Fri, 27 Sep 2024 15:04:07 -0300 Subject: [PATCH 29/29] Version bumps --- components/github/sources/new-branch/new-branch.mjs | 2 +- .../github/sources/new-card-in-column/new-card-in-column.mjs | 2 +- components/github/sources/new-collaborator/new-collaborator.mjs | 2 +- .../github/sources/new-commit-comment/new-commit-comment.mjs | 2 +- components/github/sources/new-commit/new-commit.mjs | 2 +- components/github/sources/new-discussion/new-discussion.mjs | 2 +- components/github/sources/new-fork/new-fork.mjs | 2 +- .../sources/new-issue-with-status/new-issue-with-status.mjs | 2 +- components/github/sources/new-label/new-label.mjs | 2 +- .../sources/new-or-updated-issue/new-or-updated-issue.mjs | 2 +- .../new-or-updated-milestone/new-or-updated-milestone.mjs | 2 +- .../new-or-updated-pull-request/new-or-updated-pull-request.mjs | 2 +- components/github/sources/new-release/new-release.mjs | 2 +- components/github/sources/new-star/new-star.mjs | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/github/sources/new-branch/new-branch.mjs b/components/github/sources/new-branch/new-branch.mjs index fdad80a70144b..710fe1a04655d 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.6", + version: "1.0.7", 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 305b2eeed721b..7ce3b01a02093 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.5", + version: "1.0.6", 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 c31ea5bce2e73..f422ef844af92 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.6", + version: "1.0.7", 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 8b4b271edfb7e..1af43146322f2 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.6", + version: "1.0.7", 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 a003402ec0eb5..4eb7f57a47b79 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.7", + version: "1.0.8", 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 0b15ce1079ab5..b0ad87cc0efbb 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.6", + version: "1.0.7", 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 14eeafbe944d1..4f96eba6ab4ee 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.6", + version: "1.0.7", 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 00cfa24c97625..f8c2a7adf3979 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.3", + version: "0.1.4", 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 d8ffeb7a2942a..ab8142386b786 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.6", + version: "1.0.7", 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 d084b18d3e99a..f9c78a910e5ad 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.3", + version: "1.1.4", 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 550cc2446e5bd..f21a9c8070776 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.3", + version: "1.1.4", 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 f928875ae0d12..af692b0bba51c 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.3", + version: "1.2.4", 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 d670ca3b3dce7..7d8696ebc10eb 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.6", + version: "1.0.7", 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 37c7f6bc5e013..636ec54a42b14 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.6", + version: "1.0.7", type: "source", dedupe: "unique", methods: {