-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add type SponsorshipEvent #3258
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3258 +/- ##
==========================================
- Coverage 97.72% 92.94% -4.78%
==========================================
Files 153 171 +18
Lines 13390 11663 -1727
==========================================
- Hits 13085 10840 -2245
- Misses 215 729 +514
- Partials 90 94 +4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @CodeDiego15 !
Please read step 4 of CONTRIBUTING.md and push (not force-push) the resulting changes to this PR.
Force the push? Oh sorry I didn't notice. |
No. Please push the results. (Not a big deal, but please do NOT use force push in this repo, as explained in CONTRIBUTING.md, as we always use squash and merge in this repo.) |
I did a normal git push, I don't know what happened, I'm sorry |
Once again, please read step 4 of CONTRIBUTING.md. Specifically,
|
That's what I'm trying right now, but when I do I get this: ./script/fmt.sh |
OK, then just try |
And if that fails, then please try |
That's it, some dependencies were downloaded, After that and excuse me. First time I contribute to the |
Excuse me for bothering you so much, is there something missing to solve it? |
Once you run Then, you can commit the changes, push to this PR, and the tests should all pass. |
For example: go generate ./...
git commit -sam 'run step 4'
git push origin add-sponsorship-event-type |
Signed-off-by: CodeDiego15 <[email protected]>
…iego15/go-github into add-sponsorship-event-type
I already did👍🏻 |
Was it done again as Git Push --forze? Because I did a normal git push? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update messages.go
by adding this somewhere around line 104:
"security_and_analysis": &SecurityAndAnalysisEvent{},
"sponsorship": &SponsorshipEvent{},
"star": &StarEvent{},
and also update messages_test.go
respectively. Thanks.
Hello good evening, an apology I had to leave. I'm already working on it |
Still not sorted. Please try again. |
AAAA |
I'm sorry, I don't know what to do anymore. |
No problem. I'll take over from here. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @CodeDiego15 !
LGTM.
Merging.
Thank you very much for accepting the PR will probably contribute to more issues. |
Description
This pull request adds support for the
SponsorshipEvent
to the go-github library, addressing the issue described in #2982.Details
According to GitHub documentation (SponsorshipEvent), the
SponsorshipEvent
is triggered when sponsorship changes occur, such as creation, cancellation, or tier changes.This PR introduces the following changes:
New
SponsorshipEvent
struct: Captures the key properties of a sponsorship event, including:Action
: The type of action performed (e.g.,created
,tier_changed
,cancelled
, etc.).EffectiveDate
: The date when the event or change becomes effective, applicable for events likepending_cancellation
andpending_tier_change
.Changes
: An optional field that captures details about changes, such as adjustments in sponsorship tier or privacy. This is represented by an embedded struct calledSponsorshipChanges
.Repository
,Organization
,Sender
, andInstallation
are also included to maintain consistency with other GitHub event types.New
SponsorshipChanges
struct: This struct provides additional details when thetier
orprivacy_level
of a sponsorship is modified.Tier
field captures tier changes using an embeddedSponsorshipTier
struct, which contains aFrom
field representing the previous tier.PrivacyLevel
field tracks any changes to the sponsorship’s privacy settings.This new event type will allow go-github users to programmatically handle sponsorship-related events triggered on GitHub, improving support for GitHub Sponsors workflows.
Testing
SponsorshipEvent
struct from JSON payloads.Issue Link
Resolves #2982