Skip to content

Commit

Permalink
fix: change workflow table mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Dec 9, 2024
1 parent 4000b9e commit ea9979c
Showing 3 changed files with 34 additions and 5 deletions.
22 changes: 20 additions & 2 deletions provider/describer/workflow.go
Original file line number Diff line number Diff line change
@@ -82,7 +82,16 @@ func GetRepositoryWorkflows(ctx context.Context, githubClient GitHubClient, stre
Name: workflow.GetName(),
Description: JSONAllFieldsMarshaller{
Value: model.WorkflowDescription{
Workflow: workflow,
ID: workflow.ID,
NodeID: workflow.NodeID,
Name: workflow.Name,
Path: workflow.Path,
State: workflow.State,
CreatedAt: workflow.CreatedAt,
UpdatedAt: workflow.UpdatedAt,
URL: workflow.URL,
HTMLURL: workflow.HTMLURL,
BadgeURL: workflow.BadgeURL,
RepositoryFullName: repoFullName,
WorkFlowFileContent: content,
WorkFlowFileContentJson: fileContent,
@@ -166,7 +175,16 @@ func GetRepositoryWorkflow(ctx context.Context, githubClient GitHubClient, organ
Name: workflow.GetName(),
Description: JSONAllFieldsMarshaller{
Value: model.WorkflowDescription{
Workflow: workflow,
ID: workflow.ID,
NodeID: workflow.NodeID,
Name: workflow.Name,
Path: workflow.Path,
State: workflow.State,
CreatedAt: workflow.CreatedAt,
UpdatedAt: workflow.UpdatedAt,
URL: workflow.URL,
HTMLURL: workflow.HTMLURL,
BadgeURL: workflow.BadgeURL,
RepositoryFullName: repoFullName,
WorkFlowFileContent: content,
WorkFlowFileContentJson: fileContent,
11 changes: 10 additions & 1 deletion provider/model/model.go
Original file line number Diff line number Diff line change
@@ -683,7 +683,16 @@ type UserDescription struct {
}

type WorkflowDescription struct {
*github.Workflow
ID *int64
NodeID *string
Name *string
Path *string
State *string
CreatedAt *github.Timestamp
UpdatedAt *github.Timestamp
URL *string
HTMLURL *string
BadgeURL *string
RepositoryFullName string
WorkFlowFileContent string
WorkFlowFileContentJson *github.RepositoryContent
6 changes: 4 additions & 2 deletions steampipe-plugin-github/github/table_github_workflow.go
Original file line number Diff line number Diff line change
@@ -21,10 +21,12 @@ func tableGitHubWorkflow() *plugin.Table {
},
Columns: commonColumns([]*plugin.Column{
// Top columns
{Name: "repository_full_name", Type: proto.ColumnType_STRING,
{
Name: "repository_full_name", Type: proto.ColumnType_STRING,
Transform: transform.FromField("Description.RepositoryFullName"),
Description: "Full name of the repository that contains the workflow."},
{Name: "name", Type: proto.ColumnType_STRING,
{
Name: "name", Type: proto.ColumnType_STRING,
Transform: transform.FromField("Description.Name"),
Description: "The name of the workflow."},
{Name: "id", Type: proto.ColumnType_INT,

0 comments on commit ea9979c

Please sign in to comment.