Skip to content

Commit c9e32fd

Browse files
authored
Merge pull request #14 from turbot/release/v1.0.0
Release/v1.0.0
2 parents 88994a3 + 4c4d668 commit c9e32fd

45 files changed

Lines changed: 259 additions & 256 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ git clone https://github.com/turbot/flowpipe-mod-github.git
2424
cd flowpipe-mod-github
2525
```
2626

27-
### Credentials
27+
### Connections
2828

2929
By default, the following environment variables will be used for authentication:
3030

3131
- `GITHUB_TOKEN`
3232

33-
You can also create `credential` resources in configuration files:
33+
You can also create `connection` resources in configuration files:
3434

3535
```sh
3636
vi ~/.flowpipe/config/github.fpc
3737
```
3838

3939
```hcl
40-
credential "github" "default" {
40+
connection "github" "default" {
4141
token = "ghp_..."
4242
}
4343
```
4444

45-
For more information on credentials in Flowpipe, please see [Managing Credentials](https://flowpipe.io/docs/run/credentials).
45+
For more information on connections in Flowpipe, please see [Managing Connections](https://flowpipe.io/docs/run/connections).
4646

4747
### Usage
4848

@@ -106,10 +106,10 @@ Run a pipeline:
106106
flowpipe pipeline run get_issue_by_number --arg 'issue_number=3997' --arg 'repository_owner=turbot' --arg 'repository_name=flowpipe'
107107
```
108108

109-
To use a specific `credential`, specify the `cred` pipeline argument:
109+
To use a specific `connection`, specify the `conn` pipeline argument:
110110

111111
```sh
112-
flowpipe pipeline run get_issue_by_number --arg 'issue_number=3997' --arg 'repository_owner=turbot' --arg 'repository_name=flowpipe' --arg cred=github_profile
112+
flowpipe pipeline run get_issue_by_number --arg 'issue_number=3997' --arg 'repository_owner=turbot' --arg 'repository_name=flowpipe' --arg conn=connection.github.github_profile
113113
```
114114

115115
For more examples on how you can run pipelines, please see [Run Pipelines](https://flowpipe.io/docs/run/pipelines).

locals.fp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Common descriptions
22
locals {
3-
cred_param_description = "Name for credentials to use. If not provided, the default credentials will be used."
3+
conn_param_description = "Name of Github connection to use. If not provided, the default Github connection will be used."
44
repository_owner_param_description = "The organization or user name."
55
repository_name_param_description = "The name of the repository."
66
}

mod.fp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ mod "github" {
44
color = "#191717"
55
documentation = file("./README.md")
66
icon = "/images/mods/turbot/github.svg"
7-
categories = ["software development"]
7+
categories = ["library", "software development"]
88

99
opengraph {
1010
title = "GitHub Mod for Flowpipe"
1111
description = "Run pipelines to supercharge your GitHub workflows using Flowpipe."
1212
image = "/images/mods/turbot/github-social-graphic.png"
1313
}
14+
15+
require {
16+
flowpipe {
17+
min_version = "1.0.0"
18+
}
19+
}
1420
}

pipelines/branch/create_branch.fp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ pipeline "create_branch" {
22
title = "Create Branch"
33
description = "Creates a new branch in a specified repository."
44

5-
param "cred" {
6-
type = string
7-
default = "default"
8-
description = local.cred_param_description
5+
param "conn" {
6+
type = connection.github
7+
description = local.conn_param_description
8+
default = connection.github.default
99
}
1010

1111
param "repository_owner" {
@@ -33,7 +33,7 @@ pipeline "create_branch" {
3333
method = "get"
3434
url = "https://api.github.com/repos/${param.repository_owner}/${param.repository_name}/branches/${param.source_branch}"
3535
request_headers = {
36-
Authorization = "Bearer ${credential.github[param.cred].token}"
36+
Authorization = "Bearer ${param.conn.token}"
3737
}
3838
}
3939

@@ -42,7 +42,7 @@ pipeline "create_branch" {
4242
url = "https://api.github.com/repos/${param.repository_owner}/${param.repository_name}/git/refs"
4343
request_headers = {
4444
Content-Type = "application/json"
45-
Authorization = "Bearer ${credential.github[param.cred].token}"
45+
Authorization = "Bearer ${param.conn.token}"
4646
}
4747

4848
request_body = jsonencode({

pipelines/branch/delete_branch.fp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ pipeline "delete_branch" {
22
title = "Delete Branch"
33
description = "Deletes a branch in a specified repository."
44

5-
param "cred" {
6-
type = string
7-
default = "default"
8-
description = local.cred_param_description
5+
param "conn" {
6+
type = connection.github
7+
description = local.conn_param_description
8+
default = connection.github.default
99
}
1010

1111
param "repository_owner" {
@@ -27,7 +27,7 @@ pipeline "delete_branch" {
2727
method = "delete"
2828
url = "https://api.github.com/repos/${param.repository_owner}/${param.repository_name}/git/refs/heads/${param.branch_name}"
2929
request_headers = {
30-
Authorization = "Bearer ${credential.github[param.cred].token}"
30+
Authorization = "Bearer ${param.conn.token}"
3131
}
3232

3333
throw {

pipelines/branch/get_branch.fp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ pipeline "get_branch" {
22
title = "Get branch"
33
description = "Get a branch in a specified repository."
44

5-
param "cred" {
6-
type = string
7-
default = "default"
5+
param "conn" {
6+
type = connection.github
7+
description = local.conn_param_description
8+
default = connection.github.default
89
}
910

1011
param "repository_owner" {
@@ -26,7 +27,7 @@ pipeline "get_branch" {
2627
method = "get"
2728
url = "https://api.github.com/repos/${param.repository_owner}/${param.repository_name}/branches/${param.branch_name}"
2829
request_headers = {
29-
Authorization = "Bearer ${credential.github[param.cred].token}"
30+
Authorization = "Bearer ${param.conn.token}"
3031
}
3132
error {
3233
ignore = true

pipelines/branch/tests/test_branch_operations.fp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ pipeline "test_branch_operations" {
33
description = "Test the create_branch, get_branch, and delete_branch pipelines."
44

55
tags = {
6-
type = "test"
6+
folder = "Tests"
77
}
88

9-
param "cred" {
10-
type = string
11-
description = local.cred_param_description
12-
default = "default"
9+
param "conn" {
10+
type = connection.github
11+
description = local.conn_param_description
12+
default = connection.github.default
1313
}
1414

1515
param "repository_owner" {
@@ -26,7 +26,7 @@ pipeline "test_branch_operations" {
2626

2727
step "transform" "args" {
2828
value = {
29-
cred = param.cred
29+
conn = param.conn
3030
repository_owner = param.repository_owner
3131
repository_name = param.repository_name
3232
branch_name = param.branch_name
@@ -51,15 +51,15 @@ pipeline "test_branch_operations" {
5151
}
5252

5353
output "check_create_branch" {
54-
value = step.pipeline.create_branch.output.branch.status_code == 201 ? "pass" : "fail"
54+
value = step.pipeline.create_branch.output.branch.status_code == 201 ? "pass" : "fail"
5555
}
5656

5757
output "check_get_branch" {
58-
value = step.pipeline.get_branch.output.branch.status_code == 200 ? "pass" : "fail"
58+
value = step.pipeline.get_branch.output.branch.status_code == 200 ? "pass" : "fail"
5959
}
6060

6161
output "check_delete_branch" {
62-
value = step.pipeline.delete_branch.output.branch.status_code == 204 ? "pass" : "fail"
62+
value = step.pipeline.delete_branch.output.branch.status_code == 204 ? "pass" : "fail"
6363
}
6464

6565
}

pipelines/issue/add_issue_assignees.fp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ pipeline "add_issue_assignees" {
33
description = "Add assignees to an issue."
44

55
tags = {
6-
type = "featured"
6+
recommended = "true"
77
}
88

9-
param "cred" {
10-
type = string
11-
description = local.cred_param_description
12-
default = "default"
9+
param "conn" {
10+
type = connection.github
11+
description = local.conn_param_description
12+
default = connection.github.default
1313
}
1414

1515
param "repository_owner" {
@@ -35,7 +35,7 @@ pipeline "add_issue_assignees" {
3535
step "pipeline" "get_issue_by_number" {
3636
pipeline = pipeline.get_issue_by_number
3737
args = {
38-
cred = param.cred
38+
conn = param.conn
3939
repository_owner = param.repository_owner
4040
repository_name = param.repository_name
4141
issue_number = param.issue_number
@@ -48,7 +48,7 @@ pipeline "add_issue_assignees" {
4848

4949
request_headers = {
5050
Content-Type = "application/json"
51-
Authorization = "Bearer ${credential.github[param.cred].token}"
51+
Authorization = "Bearer ${param.conn.token}"
5252
}
5353

5454
request_body = jsonencode({

pipelines/issue/close_issue.fp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ pipeline "close_issue" {
33
description = "Close an issue with the given ID."
44

55
tags = {
6-
type = "featured"
6+
recommended = "true"
77
}
88

9-
param "cred" {
10-
type = string
11-
description = local.cred_param_description
12-
default = "default"
9+
param "conn" {
10+
type = connection.github
11+
description = local.conn_param_description
12+
default = connection.github.default
1313
}
1414

1515
param "repository_owner" {
@@ -37,7 +37,7 @@ pipeline "close_issue" {
3737
pipeline = pipeline.get_issue_by_number
3838

3939
args = {
40-
cred = param.cred
40+
conn = param.conn
4141
repository_owner = param.repository_owner
4242
repository_name = param.repository_name
4343
issue_number = param.issue_number
@@ -49,7 +49,7 @@ pipeline "close_issue" {
4949
url = "https://api.github.com/graphql"
5050
request_headers = {
5151
Content-Type = "application/json"
52-
Authorization = "Bearer ${credential.github[param.cred].token}"
52+
Authorization = "Bearer ${param.conn.token}"
5353
}
5454

5555
request_body = jsonencode({

pipelines/issue/create_issue.fp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ pipeline "create_issue" {
33
description = "Create a new issue."
44

55
tags = {
6-
type = "featured"
6+
recommended = "true"
77
}
88

9-
param "cred" {
10-
type = string
11-
description = local.cred_param_description
12-
default = "default"
9+
param "conn" {
10+
type = connection.github
11+
description = local.conn_param_description
12+
default = connection.github.default
1313
}
1414

1515
param "repository_owner" {
@@ -35,7 +35,7 @@ pipeline "create_issue" {
3535
step "pipeline" "get_repository_by_full_name" {
3636
pipeline = pipeline.get_repository_by_full_name
3737
args = {
38-
cred = param.cred
38+
conn = param.conn
3939
repository_owner = param.repository_owner
4040
repository_name = param.repository_name
4141
}
@@ -46,7 +46,7 @@ pipeline "create_issue" {
4646
url = "https://api.github.com/graphql"
4747
request_headers = {
4848
Content-Type = "application/json"
49-
Authorization = "Bearer ${credential.github[param.cred].token}"
49+
Authorization = "Bearer ${param.conn.token}"
5050
}
5151

5252
request_body = jsonencode({

0 commit comments

Comments
 (0)