Add an integration test or example on how to use the addOrUpdateRepoSecret function. #1607
Comments
|
Thank you, @raboley ! Please check out our "example" directory: https://github.com/google/go-github/tree/master/example Also, please make sure to read through our CONTRIBUTING.md file to get started on putting together a PR. |
|
good |
|
x |
|
@gmlewis Thank you for the notes! Sorry for the delay, I have create PR #1626 to add an example of this the best I could. I signed the contributing agreement, and tried to follow any direction and other examples as I could! Due to mine requiring 3rd party libraries and more complexity than I would have liked the example isn't quite as simple as others, but hopefully it makes it clear enough. Open to any feedback! |
|
closed by #1626 |
I wanted to use this library to push secrets from my env to my github repo easily, and eventually got it figured out. But It would be very helpful to have an example of how to do that since it requires sodiumlib which is extremely difficult to parse if you are trying to figure out the bare minimum needed to encrypt a secret for posting to github.
essentially what I had to do to update the repo's secret was
Authenticate with github
Get the base64 encoded public key of the repo to encrypt a secret using sodiumlib
encrypt the secret string with the public key
bring it all together with AddRepoSecret function
Hopefully this helps someone, if there is a direction I should take I can work to contribute this back in some form or another.
The text was updated successfully, but these errors were encountered: