1
0
mirror of synced 2026-02-13 21:16:57 +00:00

Introduce support for looking up GH app installation ID

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
This commit is contained in:
Matheus Pimenta
2026-01-19 10:15:53 +00:00
parent c125bcb1ca
commit d57313ae2c
10 changed files with 129 additions and 151 deletions

View File

@@ -235,13 +235,22 @@ func GenerateNotation(options Options) (*manifestgen.Manifest, error) {
}
func GenerateGitHubApp(options Options) (*manifestgen.Manifest, error) {
var opts []secrets.GitHubAppOption
if owner := options.GitHubAppInstallationOwner; owner != "" {
opts = append(opts, secrets.WithGitHubAppInstallationOwner(owner))
}
if id := options.GitHubAppInstallationID; id != "" {
opts = append(opts, secrets.WithGitHubAppInstallationID(id))
}
if u := options.GitHubAppBaseURL; u != "" {
opts = append(opts, secrets.WithGitHubAppBaseURL(u))
}
secret, err := secrets.MakeGitHubAppSecret(
options.Name,
options.Namespace,
options.GitHubAppID,
options.GitHubAppInstallationID,
options.GitHubAppPrivateKey,
options.GitHubAppBaseURL,
opts...,
)
if err != nil {
return nil, err