Skip to content

Eo/add GitHub rego function#45

Merged
eochoa260 merged 11 commits intomainfrom
eo/add-github-rego-function
Aug 17, 2022
Merged

Eo/add GitHub rego function#45
eochoa260 merged 11 commits intomainfrom
eo/add-github-rego-function

Conversation

@eochoa260
Copy link
Copy Markdown
Contributor

@eochoa260 eochoa260 commented Aug 10, 2022

$ cat policy.rego                                          
package opslevel

import future.keywords

description := opslevel.repo.github("OpsLevel", "opslevel-go")["description"]
language := opslevel.repo.github("OpsLevel", "opslevel-go")["language"]                                                                                                                                                                                                                                                  

$ go run main.go run policy -f policy.rego --github-token <github-token>
{"description":"A Go client for interacting with OpsLevel","language":"Go"}

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 10, 2022

Codecov Report

Merging #45 (ed52c34) into main (f270d32) will not change coverage.
The diff coverage is n/a.

❗ Current head ed52c34 differs from pull request most recent head dcea704. Consider uploading reports for the commit dcea704 to get more accurate results

@@          Coverage Diff          @@
##            main     #45   +/-   ##
=====================================
  Coverage   3.27%   3.27%           
=====================================
  Files          5       5           
  Lines        244     244           
=====================================
  Hits           8       8           
  Misses       236     236           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment thread src/cmd/run.go Outdated

func init() {
rootCmd.AddCommand(runCmd)
runCmd.PersistentFlags().String("github-token", "", "Github API Token. Overrides environment variable 'GITHUB_API_TOKEN'")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still working on getting this to work with env var too but doesn't seem to work when I add the viper bindenv like in root.go.

Comment thread src/cmd/policy.go Outdated
Copy link
Copy Markdown
Collaborator

@rocktavious rocktavious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of questions and a few changes

Comment thread src/cmd/document.go Outdated
Comment thread src/cmd/policy.go Outdated
Comment thread src/cmd/policy.go
Comment thread src/cmd/policy.go Outdated
Comment thread src/cmd/policy.go Outdated
Comment thread src/cmd/policy.go
@eochoa260 eochoa260 requested a review from rocktavious August 12, 2022 18:24
Comment thread src/cmd/policy.go Outdated
Comment thread src/cmd/policy.go Outdated
Comment thread src/cmd/policy.go Outdated
Comment thread src/cmd/policy.go Outdated
Comment thread src/cmd/policy.go
Copy link
Copy Markdown
Collaborator

@rocktavious rocktavious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eochoa260 eochoa260 merged commit 3fdec12 into main Aug 17, 2022
@eochoa260 eochoa260 deleted the eo/add-github-rego-function branch August 17, 2022 18:57
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.

2 participants