Skip to content

Commit

Permalink
Merge pull request #23 from shrutimantri/full-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
wrussell1999 authored Aug 22, 2024
2 parents 66ab236 + afbc56f commit 79915ca
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 134 deletions.
34 changes: 23 additions & 11 deletions src/main/java/io/kestra/plugin/github/code/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,34 @@
@Plugin(
examples = {
@Example(
title = "Search for code in a repository.",
full = true,
code = """
id: search
type: io.kestra.plugin.github.code.Search
oauthToken: your_github_token
query: "addClass in:file language:js repo:jquery/jquery"
id: github_code_search_flow
namespace: company.team
tasks:
- id: search_code
type: io.kestra.plugin.github.code.Search
oauthToken: your_github_token
query: "addClass in:file language:js repo:jquery/jquery"
"""
),
@Example(
title = "Search for code in a repository.",
full = true,
code = """
id: search
type: io.kestra.plugin.github.code.Search
oauthToken: your_github_token
query: addClass
in: file
language: js
repository: jquery/jquery
id: github_code_search_flow
namespace: company.team
tasks:
- id: search_code
type: io.kestra.plugin.github.code.Search
oauthToken: your_github_token
query: addClass
in: file
language: js
repository: jquery/jquery
"""
)
}
Expand Down
34 changes: 23 additions & 11 deletions src/main/java/io/kestra/plugin/github/commits/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,38 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Search for GitHub commits",
description = "Requires authentication"
title = "Search for GitHub commits.",
description = "Requires authentication."
)
@Plugin(
examples = {
@Example(
title = "Search for commits in a repository.",
full = true,
code = """
id: commits
type: io.kestra.plugin.github.commits.Search
oauthToken: your_github_token
query: "Initial repo:kestra-io/plugin-github language:java"
id: github_commit_search_flow
namespace: company.team
tasks:
- id: search_commit
type: io.kestra.plugin.github.commits.Search
oauthToken: your_github_token
query: "Initial repo:kestra-io/plugin-github language:java"
"""
),
@Example(
title = "Search for commits in a repository.",
full = true,
code = """
id: commits
type: io.kestra.plugin.github.commits.Search
oauthToken: your_github_token
query: Initial
repository: kestra-io/plugin-github
id: github_commit_search_flow
namespace: company.team
tasks:
- id: search_commit
type: io.kestra.plugin.github.commits.Search
oauthToken: your_github_token
query: Initial
repository: kestra-io/plugin-github
"""
)
}
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/io/kestra/plugin/github/issues/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@
@Plugin(
examples = {
@Example(
title = "Put a comment on an issue in a repository.",
full = true,
code = """
id: comment
type: io.kestra.plugin.github.issues.Comment
oauthToken: your_github_token
repository: kestra-io/kestra
issueNumber: 1347
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
id: github_comment_on_issue_flow
namespace: company.team
tasks:
- id: comment_on_issue
type: io.kestra.plugin.github.issues.Comment
oauthToken: your_github_token
repository: kestra-io/kestra
issueNumber: 1347
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
"""
)
}
Expand Down
81 changes: 47 additions & 34 deletions src/main/java/io/kestra/plugin/github/issues/Create.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,62 @@
@Plugin(
examples = {
@Example(
title = "Create an issue in a repository",
title = "Create an issue in a repository using JWT token.",
full = true,
code = """
id: create
type: io.kestra.plugin.github.issues.Create
jwtToken: your_github_jwt_token
repository: kestra-io/kestra
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
labels:
- bug
- workflow
id: github_issue_create_flow
namespace: company.team
tasks:
- id: create_issue
type: io.kestra.plugin.github.issues.Create
jwtToken: your_github_jwt_token
repository: kestra-io/kestra
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
labels:
- bug
- workflow
"""
),
@Example(
title = "Create an issue in a repository",
title = "Create an issue in a repository using OAuth token.",
code = """
id: create
type: io.kestra.plugin.github.issues.Create
login: your_github_login
oauthToken: your_github_token
repository: kestra-io/kestra
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
labels:
- bug
- workflow
id: github_issue_create_flow
namespace: company.team
tasks:
- id: create_issue
type: io.kestra.plugin.github.issues.Create
login: your_github_login
oauthToken: your_github_token
repository: kestra-io/kestra
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
labels:
- bug
- workflow
"""
),
@Example(
title = "Create an issue in a repository",
title = "Create an issue in a repository with assignees.",
code = """
id: create
type: io.kestra.plugin.github.issues.Create
oauthToken: your_github_token
repository: kestra-io/kestra
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
labels:
- bug
- workflow
assignees:
- MyDeveloperUserName
- MyDesignerUserName
id: github_issue_create_flow
namespace: company.team
tasks:
- id: create_issue
type: io.kestra.plugin.github.issues.Create
oauthToken: your_github_token
repository: kestra-io/kestra
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
labels:
- bug
- workflow
assignees:
- MyDeveloperUserName
- MyDesignerUserName
"""
)
}
Expand Down
29 changes: 20 additions & 9 deletions src/main/java/io/kestra/plugin/github/issues/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,31 @@
@Plugin(
examples = {
@Example(
title = "Search for issues in a repository.",
full = true,
code = """
id: search
type: io.kestra.plugin.github.issues.Search
oauthToken: your_github_token
query: "repo:kestra-io/plugin-github is:open"
id: github_issue_search_flow
namespace: company.team
tasks:
- id: search_issues
type: io.kestra.plugin.github.issues.Search
oauthToken: your_github_token
query: "repo:kestra-io/plugin-github is:open"
"""
),
@Example(
title = "Search for open issues in a repository.",
code = """
id: search
type: io.kestra.plugin.github.issues.Search
oauthToken: your_github_token
repository: kestra-io/plugin-github
open: TRUE
id: github_issue_search_flow
namespace: company.team
tasks:
- id: search_open_issues
type: io.kestra.plugin.github.issues.Search
oauthToken: your_github_token
repository: kestra-io/plugin-github
open: TRUE
"""
)
}
Expand Down
26 changes: 16 additions & 10 deletions src/main/java/io/kestra/plugin/github/pulls/Create.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,27 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Create a pull request",
description = "If no authentication is provided, anonymous authentication will be used"
title = "Create a pull request.",
description = "If no authentication is provided, anonymous authentication will be used."
)
@Plugin(
examples = {
@Example(
title = "Create a pull request in a repository.",
full = true,
code = """
id: create
type: io.kestra.plugin.github.pulls.Create
oauthToken: your_github_token
repository: kestra-io/kestra
sourceBranch: develop
targetBranch: main
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
id: github_pulls_create_flow
namespace: company.team
tasks:
- id: create_pull_request
type: io.kestra.plugin.github.pulls.Create
oauthToken: your_github_token
repository: kestra-io/kestra
sourceBranch: develop
targetBranch: main
title: Workflow failed
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
"""
)
}
Expand Down
30 changes: 21 additions & 9 deletions src/main/java/io/kestra/plugin/github/pulls/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,32 @@
@Plugin(
examples = {
@Example(
title = "Search for pull requests in a repository.",
full = true,
code = """
id: search
type: io.kestra.plugin.github.pulls.Search
oauthToken: your_github_token
query: "repo:kestra-io/plugin-github is:open"
id: github_pulls_search_flow
namespace: company.team
tasks:
- id: search_pull_requests
type: io.kestra.plugin.github.pulls.Search
oauthToken: your_github_token
query: "repo:kestra-io/plugin-github is:open"
"""
),
@Example(
title = "Search for open pull requests in a repository.",
full = true,
code = """
id: search
type: io.kestra.plugin.github.pulls.Search
oauthToken: your_github_token
repository: kestra-io/plugin-github
open: TRUE
id: github_pulls_search_flow
namespace: company.team
tasks:
- id: search_open_pull_requests
type: io.kestra.plugin.github.pulls.Search
oauthToken: your_github_token
repository: kestra-io/plugin-github
open: TRUE
"""
)
}
Expand Down
Loading

0 comments on commit 79915ca

Please sign in to comment.