Skip to content

Fix incorrect workflow_id type for workflow_run table#558

Open
WallyGuzman wants to merge 1 commit into
turbot:mainfrom
WallyGuzman:github_actions_repository_workflow_run
Open

Fix incorrect workflow_id type for workflow_run table#558
WallyGuzman wants to merge 1 commit into
turbot:mainfrom
WallyGuzman:github_actions_repository_workflow_run

Conversation

@WallyGuzman

@WallyGuzman WallyGuzman commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
  • Remove unecessary strconv to match other workflow-related tables
  • Add optional quals for headSha, actorLogin, and createdAt
  • Fix minor bug in workflow_job to handle missing CompletedAt fields
  • Also minor typo fix in docs and new query example with dates

Note: I'm not really sure why this was coming in as a string. Both versions of the REST API [1,2] show workflow_id as an integer and the go-github library sets it to int64 [3]. Either way, this PR represents a breaking change for any customers who rely on workflow_id being of type string.

Please let me know if there's a specific way to structure this change or otherwise handle versioning/communication for this.

Edit: Also bundled minor bug fix for github_actions_repository_workflow_job.

[1] https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository
[2] https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2026-03-10#list-workflow-runs-for-a-repository
[3] https://pkg.go.dev/github.com/google/go-github/v55@v55.0.0/github#WorkflowRun

Example query results

Results

Before

> select
  id,
  event,
  workflow_id,
  conclusion,
  status, created_at
from
    github_actions_repository_workflow_run
where
  repository_full_name = 'turbot/steampipe'
  and conclusion = 'failure'
  limit 1;

+----------------+---------+-------------+------------+-----------+----------------------+
| id             | event   | workflow_id | conclusion | status    | created_at           |
+----------------+---------+-------------+------------+-----------+----------------------+
| 28,581,927,216 | dynamic | 132357350   | failure    | completed | 2026-07-02T10:04:46Z |
+----------------+---------+-------------+------------+-----------+----------------------+
1 row

After

> select
  id,
  event,
  workflow_id,
  conclusion,
  status, created_at
from
    github_actions_repository_workflow_run
where
  repository_full_name = 'turbot/steampipe'
  and conclusion = 'failure'
  limit 1;
+----------------+---------+-------------+------------+-----------+----------------------+
| id             | event   | workflow_id | conclusion | status    | created_at           |
+----------------+---------+-------------+------------+-----------+----------------------+
| 28,581,927,216 | dynamic | 132,357,350 | failure    | completed | 2026-07-02T10:04:46Z |
+----------------+---------+-------------+------------+-----------+----------------------+
1 row

Other queries

> .output line;
> select
  id,
  event,
  workflow_id,
  conclusion,
  status,
  run_number,
  workflow_url,
  head_commit,
  head_branch,
  created_at
from
  github_actions_repository_workflow_run
where
  repository_full_name = 'turbot/steampipe'
  and created_at >= '2026-01-01'
  and created_at <= '2026-02-01'
  limit 1;

-[ RECORD 1  ]---------------------------------------------------------------------------
id           | 21,541,410,334
event        | schedule
workflow_id  | 172,982,979
conclusion   | success
status       | completed
run_number   | 209
workflow_url | https://api.github.com/repos/turbot/steampipe/actions/workflows/172982979
head_commit  | {"author":{"email":"45908484+pskrbasu@users.noreply.github.com","name":"Puskar Basu"},"committer":{"email":"noreply@github.com","name":"GitHub"},"id":"bcaab8ddac2fd2549cd0c70bfcc1a592eae9a733","message":"Merge branch 'v2.3.x' into develop #4925","timestamp":"2026-01-30T09:52:47Z","tree_id":"b6df9bc4fc7ebe50cbe37ffe61792c994cb8e91b"}
head_branch  | develop
created_at   | 2026-01-31T08:04:20Z

Also some database logs during the query above:

2026-07-24 13:56:07.271 UTC [TRACE] hub: GetSchema for connection 'github'
2026-07-24 13:56:07.271 UTC [TRACE] hub: connection data for connection 'github' is already loaded and schema is static - returning cached schema
2026-07-24 13:56:07.271 UTC [INFO]  hub: static schema - using same limit for all connections
2026-07-24 13:56:07.271 UTC [TRACE] hub: shouldPushdownLimit found key column for column repository_full_name: name:"repository_full_name"  operators:"="  require:"required"  cache_match:"subset"
2026-07-24 13:56:07.271 UTC [TRACE] hub: shouldPushdownLimit operator '=' is supported for column 'repository_full_name'.
2026-07-24 13:56:07.271 UTC [TRACE] hub: shouldPushdownLimit found key column for column created_at: name:"created_at"  operators:">"  operators:">="  operators:"<"  operators:"<="  operators:"="  require:"optional"  cache_match:"subset"
2026-07-24 13:56:07.271 UTC [TRACE] hub: shouldPushdownLimit operator '>=' is supported for column 'created_at'.
2026-07-24 13:56:07.271 UTC [TRACE] hub: shouldPushdownLimit operator '<=' is supported for column 'created_at'.
2026-07-24 13:56:07.271 UTC [INFO]  hub: shouldPushdownLimit all quals are supported - pushing down limit
2026-07-24 13:56:07.271 UTC [INFO]  hub: connection 'github', table 'github_actions_repository_workflow_run', quals
----------------------------------------------------------------
Column: created_at, Operator: '>=', Value: '2026-01-01 18:00:00 -0600 CST'
Column: created_at, Operator: '<=', Value: '2026-02-01 18:00:00 -0600 CST'
Column: repository_full_name, Operator: '=', Value: 'turbot/steampipe'

- Remove unecessary strconv to match other workflow-related tables
- Add optional quals for headSha, actorLogin, and createdAt
- Fix minor bug in workflow_job to handle missing CompletedAt fields
- Also minor typo fix in docs and new query example with dates
@WallyGuzman
WallyGuzman force-pushed the github_actions_repository_workflow_run branch from a93ac88 to afc789d Compare July 25, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant