-
Notifications
You must be signed in to change notification settings - Fork 188
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
First attempt at GitHub Secrets #184
base: master
Are you sure you want to change the base?
First attempt at GitHub Secrets #184
Conversation
I considered adding support for the Org-level secrets but put that on hold for now: |
So, something I was thinking about... since PowerShellForGitHub exposes
Then I'll make my own module called
|
I think that would totally unblock this in the short term, and provides an easy path towards moving |
77d5805
to
fdf6477
Compare
Alright I removed those but to write tests I need you to add a couple test secrets to either one of the test repos or to this repo. Let me know when you do that - I can't get the value so set that to whatever. The name can be whatever you want but share those here for me. |
Would an organization secret work? A secret stored in this repository won't help, because the accounts that are used while running CI don't have access to this repo. And there currently is no repo that is guaranteed to exist in any of the test accounts...but the organization is guaranteed to be available, so I could add a secret to the test organizations. If you do this though, you should add a comment to the tests (and to the CONTRIBUTING.md documentation in the tests section) to indicate that there is the expectation for those secrets to exist in the test organization in order for those tests to succeed... |
No I don't think org secrets will work. That's a separate API and should be tested in and of itself. |
@HowardWolosky if this gets completed and merged I would happily contribute a Powershell SecretManagement Provider that would leverage this API to easily fetch repository secrets. |
@JustinGrote the problem is that there's no way to retrieve the value of secrets. You can set them and list meta data about them, but you can't get them. |
This adds the following cmdlets:
Get-GitHubRepositoryPublicKey
- https://developer.github.com/v3/actions/secrets/#get-a-repository-public-keyGet-GitHubSecretInfo
- https://developer.github.com/v3/actions/secrets/#list-repository-secrets and https://developer.github.com/v3/actions/secrets/#get-a-repository-secretSet-GitHubSecret
- https://developer.github.com/v3/actions/secrets/#create-or-update-a-repository-secretNew-GitHubSecret
- https://developer.github.com/v3/actions/secrets/#create-or-update-a-repository-secret but with an "exists" checkRemove-GitHubSecret
- https://developer.github.com/v3/actions/secrets/#delete-a-repository-secretThis does take a dependency on a module I created for this use-case: PSSodium
https://www.powershellgallery.com/packages/PSSodium/0.2.0
which just exposes a
I'll get that in its own repo soon-ish.Done: https://github.com/TylerLeonhardt/PSSodiumOpen questions
any way I can avoid that?