Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/github/actions/create-branch/create-branch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "github-create-branch",
name: "Create Branch",
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.16",
version: "0.0.17",
type: "action",
props: {
github,
Expand Down
2 changes: 1 addition & 1 deletion components/github/actions/create-gist/create-gist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.10",
version: "0.0.11",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.21",
version: "0.0.22",
type: "action",
props: {
github,
Expand Down
2 changes: 1 addition & 1 deletion components/github/actions/create-issue/create-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.3",
version: "0.3.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "github-create-or-update-file-contents",
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.3",
version: "0.1.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.3",
version: "0.1.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.16",
version: "0.0.17",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "github-create-workflow-dispatch",
name: "Create Workflow Dispatch",
description: "Creates a new workflow dispatch event. [See the documentation](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "github-disable-workflow",
name: "Disable Workflow",
description: "Disables a workflow and sets the **state** of the workflow to **disabled_manually**. [See the documentation](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#disable-a-workflow)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "github-enable-workflow",
name: "Enable Workflow",
description: "Enables a workflow and sets the **state** of the workflow to **active**. [See the documentation](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
github,
Expand Down
37 changes: 37 additions & 0 deletions components/github/actions/get-commit/get-commit.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import github from "../../github.app.mjs";

export default {
key: "github-get-commit",
name: "Get Commit",
description: "Get a commit in a Github repo. [See the documentation](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#get-a-commit)",
version: "0.0.1",
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
commitSha: {
propDefinition: [
github,
"commitSha",
(c) => ({
repoFullname: c.repoFullname,
}),
],
},
},
async run({ $ }) {
const commit = await this.github.getCommit({
repoFullname: this.repoFullname,
commitRef: this.commitSha,
});

$.export("$summary", `Successfully retrieved commit ${this.commitSha}`);

return commit;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -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.21",
version: "0.0.22",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "github-get-repository-content",
name: "Get Repository Content",
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.3",
version: "0.1.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "github-get-repository",
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.21",
version: "0.0.22",
type: "action",
props: {
github,
Expand Down
2 changes: 1 addition & 1 deletion components/github/actions/get-reviewers/get-reviewers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.3",
version: "0.1.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "github-get-workflow-run",
name: "Get Workflow Run",
description: "Gets a specific workflow run. [See the documentation](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
github,
Expand Down
82 changes: 82 additions & 0 deletions components/github/actions/list-commits/list-commits.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import github from "../../github.app.mjs";

export default {
key: "github-list-commits",
name: "List Commits",
description: "List commits in a Github repo. [See the documentation](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits)",
version: "0.0.1",
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
sha: {
propDefinition: [
github,
"branchSha",
(c) => ({
repoFullname: c.repoFullname,
}),
],
description: "SHA or branch to start listing commits from. Default: the repository's default branch (usually main).",
optional: true,
},
path: {
type: "string",
label: "Path",
description: "Only commits containing this file path will be returned",
optional: true,
},
author: {
type: "string",
label: "Author",
description: "GitHub username or email address to use to filter by commit author.",
optional: true,
},
committer: {
type: "string",
label: "Committer",
description: "GitHub username or email address to use to filter by commit committer",
optional: true,
},
since: {
type: "string",
label: "Since",
description: "Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`",
optional: true,
},
until: {
type: "string",
label: "Until",
description: "Only commits before this date will be returned. This is a timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`",
optional: true,
},
maxResults: {
type: "integer",
label: "Max Results",
description: "The maximum number of results to return. Defaults: `100`",
default: 100,
optional: true,
},
},
async run({ $ }) {
const commits = await this.github.listCommits({
repoFullname: this.repoFullname,
sha: this.sha,
path: this.path,
author: this.author,
committer: this.committer,
since: this.since,
until: this.until,
per_page: this.maxResults,
});

$.export("$summary", `Successfully retrieved ${commits.length} commits.`);

return commits;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
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.3",
version: "0.1.4",
type: "action",
props: {
github: {

Check warning on line 11 in components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop github must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 11 in components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop github must have a label. See https://pipedream.com/docs/components/guidelines/#props
...github,
reloadProps: true,
},
Expand Down
2 changes: 1 addition & 1 deletion components/github/actions/list-releases/list-releases.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.9",
version: "0.0.10",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "github-list-workflow-runs",
name: "List Workflow Runs",
description: "List workflowRuns for a repository [See the documentation](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
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.5",
version: "0.2.6",
type: "action",
props: {
github,
infoBox: {

Check warning on line 11 in components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop infoBox must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 11 in components/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop infoBox must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `Example query: \`bug report in:title type:issue repo:octocat/Hello-World\`
Expand Down
2 changes: 1 addition & 1 deletion components/github/actions/star-repo/star-repo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "github-star-repo",
name: "Star Repo",
description: "Star a repository. [See the docs](https://docs.github.com/en/rest/activity/starring?apiVersion=2022-11-28#star-a-repository-for-the-authenticated-user) for more info.",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
github,
Expand Down
2 changes: 1 addition & 1 deletion components/github/actions/update-gist/update-gist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
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.10",
version: "0.0.11",
type: "action",
props: {
github,
infoAlert: {

Check warning on line 13 in components/github/actions/update-gist/update-gist.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop infoAlert must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 13 in components/github/actions/update-gist/update-gist.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop infoAlert must have a label. See https://pipedream.com/docs/components/guidelines/#props
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.",
Expand Down
2 changes: 1 addition & 1 deletion components/github/actions/update-issue/update-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.2.3",
version: "0.2.4",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
version: "0.0.6",
type: "action",
props: {
github,
Expand Down
46 changes: 46 additions & 0 deletions components/github/github.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,40 @@ export default {
}));
},
},
branchSha: {
label: "Branch SHA",
description: "SHA of a branch",
type: "string",
async options({
page, repoFullname,
}) {
const branches = await this.getBranches({
repoFullname,
per_page: constants.LIMIT,
page: page + 1,
});

return branches.map((branch) => ({
label: branch.name,
value: branch.commit.sha,
}));
},
},
commitSha: {
type: "string",
label: "Commit SHA",
description: "A commit SHA to retrieve",
async options({
repoFullname, page,
}) {
const commits = await this.listCommits({
repoFullname,
per_page: constants.LIMIT,
page: page + 1,
});
return commits.map((commit) => commit.sha);
},
},
},
methods: {
_baseApiUrl() {
Expand Down Expand Up @@ -900,5 +934,17 @@ export default {

return response.data;
},
async getCommit({
repoFullname, commitRef,
}) {
const response = await this._client().request(`GET /repos/${repoFullname}/commits/${commitRef}`, {});
return response.data;
},
async listCommits({
repoFullname, ...args
}) {
const response = await this._client().request(`GET /repos/${repoFullname}/commits`, args);
return response.data;
},
},
};
2 changes: 1 addition & 1 deletion components/github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/github",
"version": "1.7.2",
"version": "1.8.0",
"description": "Pipedream Github Components",
"main": "github.app.mjs",
"keywords": [
Expand Down
Loading
Loading