Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: repository ruleset event type not defined #3295

Closed
rbtcollins opened this issue Sep 29, 2024 · 8 comments · Fixed by #3305
Closed

Feature: repository ruleset event type not defined #3295

rbtcollins opened this issue Sep 29, 2024 · 8 comments · Fixed by #3305

Comments

@rbtcollins
Copy link

From cbrgm/githubevents#94 (comment) - GitHub are now creating repository rulesets by default rather than branch protection rules (via the UI at least).

API definition.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 29, 2024

Would you like to create a PR for this, @rbtcollins , or shall I open this up to other contributors to this repo?

@rbtcollins
Copy link
Author

I don't think I have an active google CLA with my current employer, and last time I discussed such with legal we got stuck. So I'm not sure I can commit to a PR.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 29, 2024

This would be a great PR for any new contributor to this repo or a new Go developer.
All contributions are greatly appreciated!

Feel free to volunteer for any issue and the issue can be assigned to you so that others don't attempt to duplicate the work.

Please check out our CONTRIBUTING.md guide to get started. (In particular, please remember to go generate ./... and don't use force-push to your PRs.)

Thank you!

@unamdev0
Copy link
Contributor

unamdev0 commented Oct 2, 2024

Hi @gmlewis @rbtcollins I'd like to work on this

@gmlewis
Copy link
Collaborator

gmlewis commented Oct 2, 2024

Hi @gmlewis @rbtcollins I'd like to work on this

Thank you, @unamdev0 !
It's yours.

@unamdev0
Copy link
Contributor

unamdev0 commented Oct 2, 2024

Hi @gmlewis, one small doubt, if you check the properties of repository_ruleset object here, there's a condition key which is given as object or null, but what'll be the keys for this object are not given.

What should be done in this case? should I declare it as map[string]interface{} field as to accommodate anything that comes inside condition object

@gmlewis
Copy link
Collaborator

gmlewis commented Oct 2, 2024

What should be done in this case?

When we don't know what the object will be, we typically use a json.RawMessage to represent it so that it can be more easily unmarshaled after its type is known (by the user after processing the rest of the struct).

Here are some existing examples you can take a look at from this repo:

json RawMessage-2024-10-02_09-59-43

@unamdev0
Copy link
Contributor

unamdev0 commented Oct 2, 2024

Cool, will use this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants