|
|
@@ -23,6 +23,8 @@ type GithubActions struct {
|
|
|
GithubConf *oauth2.Config
|
|
|
|
|
|
WebhookToken string
|
|
|
+ PorterToken string
|
|
|
+ ProjectID uint
|
|
|
ReleaseName string
|
|
|
}
|
|
|
|
|
|
@@ -40,6 +42,13 @@ func (g *GithubActions) Setup() error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+ // create a new secret with a porter token
|
|
|
+ err = g.createGithubSecret(client, g.getPorterTokenSecretName(), g.PorterToken)
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
@@ -133,3 +142,7 @@ func (g *GithubActions) getWebhookSecretName() string {
|
|
|
strings.ToUpper(g.ReleaseName), "-", "_", -1),
|
|
|
)
|
|
|
}
|
|
|
+
|
|
|
+func (g *GithubActions) getPorterTokenSecretName() string {
|
|
|
+ return fmt.Sprintf("PORTER_TOKEN_%d", g.ProjectID)
|
|
|
+}
|