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
3 changes: 3 additions & 0 deletions components/github/actions/common/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const PULL_REQUEST_STATES = [
"PENDING",
];

const LIMIT = 100;

export default {
PULL_REQUEST_STATES,
LIMIT,
};
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.13",
version: "0.0.14",
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.7",
version: "0.0.8",
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.18",
version: "0.0.19",
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.0",
version: "0.3.1",
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.0",
version: "0.1.1",
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.0",
version: "0.1.1",
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.13",
version: "0.0.14",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { ConfigurationError } from "@pipedream/platform";
import github from "../../github.app.mjs";

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.1",
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
workflowId: {
propDefinition: [
github,
"workflowId",
({ repoFullname }) => ({
repoFullname,
}),
],
},
ref: {
type: "string",
label: "Ref",
description: "The git reference for the workflow. The reference can be a branch or tag name.",
},
inputs: {
type: "object",
label: "Inputs",
description: "Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when inputs are omitted.",
optional: true,
},
},
async run({ $ }) {
try {
const response = await this.github.createWorkflowDispatch({
repoFullname: this.repoFullname,
workflowId: this.workflowId,
data: {
ref: this.ref,
inputs: this.inputs,
},
});

$.export("$summary", "Workflow dispatch successfully created!");

return response;
} catch (e) {
throw new ConfigurationError(e?.response?.data?.message);
}
},
};
42 changes: 42 additions & 0 deletions components/github/actions/disable-workflow/disable-workflow.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { ConfigurationError } from "@pipedream/platform";
import github from "../../github.app.mjs";

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.1",
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
workflowId: {
propDefinition: [
github,
"workflowId",
({ repoFullname }) => ({
repoFullname,
}),
],
},
},
async run({ $ }) {
try {
const response = await this.github.disableWorkflow({
repoFullname: this.repoFullname,
workflowId: this.workflowId,
});

$.export("$summary", `Successfully disabled the workflow with Id: ${this.workflowId}!`);

return response;
} catch (e) {
throw new ConfigurationError(e?.response?.data?.message);
}
},
};
37 changes: 37 additions & 0 deletions components/github/actions/enable-workflow/enable-workflow.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-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.1",
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
workflowId: {
propDefinition: [
github,
"workflowId",
({ repoFullname }) => ({
repoFullname,
}),
],
},
},
async run({ $ }) {
const response = await this.github.enableWorkflow({
repoFullname: this.repoFullname,
workflowId: this.workflowId,
});

$.export("$summary", `Successfully enabled the workflow with Id: ${this.workflowId}!`);

return response;
},
};
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.18",
version: "0.0.19",
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.0",
version: "0.1.1",
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.18",
version: "0.0.19",
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.0",
version: "0.1.1",
type: "action",
props: {
github,
Expand Down
37 changes: 37 additions & 0 deletions components/github/actions/get-workflow-run/get-workflow-run.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-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.1",
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
workflowRunId: {
propDefinition: [
github,
"workflowRunId",
({ repoFullname }) => ({
repoFullname,
}),
],
},
},
async run({ $ }) {
const response = await this.github.getWorkflowRun({
repoFullname: this.repoFullname,
workflowRunId: this.workflowRunId,
});

$.export("$summary", `Successfully retrieved the workflow run with Id: ${this.workflowRunId}!.`);

return response;
},
};
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.0",
version: "0.1.1",
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 label. 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 description. 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.6",
version: "0.0.7",
type: "action",
props: {
github,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import github from "../../github.app.mjs";

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.1",
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
limit: {
type: "integer",
label: "Limit",
description: "The maximum quantity to be returned.",
default: 100,
},
},
async run({ $ }) {
let page = 1;
const perPage = 100;
let allWorkflowRuns = [];
let count = 0;

while (count < this.limit) {
const { workflow_runs: workflowRuns } = await this.github.listWorkflowRuns({
repoFullname: this.repoFullname,
perPage: perPage,
page: page,
});

if (workflowRuns.length === 0) {
break;
}

allWorkflowRuns = allWorkflowRuns.concat(workflowRuns);
count += workflowRuns.length;
page += 1;
}

$.export("$summary", `Successfully retrieved ${allWorkflowRuns.length} workflow runs.`);

return allWorkflowRuns;
},
};
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.0",
version: "0.2.1",
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 label. 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 description. 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/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.7",
version: "0.0.8",
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 label. 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 description. 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.0",
version: "0.2.1",
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.2",
version: "0.0.3",
type: "action",
props: {
github,
Expand Down
Loading
Loading