feat: Add GH Workflow support#3195
Merged
kodiakhq[bot] merged 10 commits intocloudquery:mainfrom Dec 12, 2022
Merged
Conversation
bbernays
commented
Oct 25, 2022
Comment on lines
+13
to
+39
| opts := &github.RepositoryListByOrgOptions{ListOptions: github.ListOptions{PerPage: 100}} | ||
| for { | ||
| repos, resp, err := c.Github.Repositories.ListByOrg(ctx, c.Org, opts) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| for _, repo := range repos { | ||
| actionOpts := &github.ListOptions{PerPage: 100} | ||
| for { | ||
| workflows, resp, err := c.Github.Actions.ListWorkflows(ctx, *repo.Owner.Login, *repo.Name, actionOpts) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| res <- workflows.Workflows | ||
| opts.Page = resp.NextPage | ||
| if opts.Page == resp.LastPage { | ||
| break | ||
| } | ||
| } | ||
| } | ||
| opts.Page = resp.NextPage | ||
| if opts.Page == resp.LastPage { | ||
| break | ||
| } | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
This is not optimized as the only multiplexer that is available is an org multiplexer
erezrokah
approved these changes
Oct 30, 2022
Member
erezrokah
left a comment
There was a problem hiding this comment.
Thanks @bbernays this works pending a way to multiplex repositories (unrelated to this PR).
Approved pending a mock test for it. Is GetWorkflowFile required? Looking the GitHub API we get the same data as the list operation:
https://docs.github.com/en/rest/actions/workflows#get-a-workflow
hermanschaaf
approved these changes
Nov 2, 2022
Member
|
@bbernays Should we bring this PR up to speed? |
4bfc131 to
cbfe918
Compare
This PR has the following changes to source plugin(s) tables:
|
Member
|
So I brought this PR up to speed in c7d7029 and cbfe918. cbfe918 also changes the
|
kodiakhq bot
pushed a commit
that referenced
this pull request
Dec 13, 2022
🤖 I have created a release *beep* *boop* --- ## [1.4.0](plugins-source-github-v1.3.0...plugins-source-github-v1.4.0) (2022-12-13) ### Features * Add GH Workflow support ([#3195](#3195)) ([098ac50](098ac50)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.11.1 ([#5458](#5458)) ([58b7432](58b7432)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.11.2 ([#5497](#5497)) ([c1876cf](c1876cf)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.12.0 ([#5539](#5539)) ([fb71293](fb71293)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support Github Actions
To do:
GetWorkflowFile