https://github.com/sorenmat/github-secret
Go library for accessing Githubs secrets API
https://github.com/sorenmat/github-secret
github golang secret
Last synced: 5 months ago
JSON representation
Go library for accessing Githubs secrets API
- Host: GitHub
- URL: https://github.com/sorenmat/github-secret
- Owner: sorenmat
- License: mit
- Created: 2020-02-01T16:15:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-03T16:08:11.000Z (over 6 years ago)
- Last Synced: 2024-06-20T05:12:11.598Z (about 2 years ago)
- Topics: github, golang, secret
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-secret
Go library for accessing Githubs secrets API
## Build
`go build`
## Install
`go install`
## Godoc
```
FUNCTIONS
func DeleteSecret(org, repo, name, token string) error
DeleteSecret deletes a given secret in a repository
func Updatesecret(org, repo, name, value, token string) error
Updatesecret will create or update a given secret. Please note this calls
PrivateKey in order to fetch the given public for that repostiory in the
organization
TYPES
type GithubPublickey struct {
Key string `json:"key"`
KeyID string `json:"key_id"`
}
func GetPublickey(org, repo, token string) *GithubPublickey
GetPublickey retrieves the public key from a give repository in a given
organizaion
type Secret struct {
CreatedAt string `json:"created_at"`
Name string `json:"name"`
UpdatedAt string `json:"updated_at"`
}
Secret is the represenation of a single secret, node this contains on the
name of the secret and not the actual decrypted value
func GetSecret(org, repo, name, token string) *Secret
GetSecret finds a given secret in a repository
type Secrets struct {
TotalCount int `json:"total_count"`
Secrets []Secret `json:"secrets"`
}
Secrets contain all the secrets from a repository
func GetSecrets(org, repo, token string) *Secrets
GetSecrets get's all the secrets from a repository in a organization
```