Skip to content

Commit

Permalink
Move the URL to use secretEnv in k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaslana committed Jul 31, 2024
1 parent d9f0655 commit d57bd9a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
mode:
- name: label-prs
- name: notify-stale-prs
- name: notify-pending-prs
steps:
- uses: actions/checkout@v4

Expand Down
6 changes: 5 additions & 1 deletion cmd/notifyPendingCI.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"context"
"os"
"time"

"github.com/google/go-github/v60/github"
Expand All @@ -26,7 +27,10 @@ var notifyPendingCICmd = &cobra.Command{
slogs.Logr.Fatal("Error loading config", "error", err)
}
client := github.NewClient(nil).WithAuthToken(cfg.GithubToken)
webhookURL := "https://alert-receiver.chiaops.com/teambottesting"
webhookURL := os.Getenv("KEYBASE_WEBHOOK_URL")
if webhookURL == "" {
slogs.Logr.Error("KEYBASE_WEBHOOK_URL environment variable is not set")
}

datastore, err := database.NewDatastore(
viper.GetString("db-host"),
Expand Down
6 changes: 5 additions & 1 deletion cmd/notifyStale.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"context"
"os"
"time"

"github.com/google/go-github/v60/github"
Expand All @@ -26,7 +27,10 @@ var notifyStaleCmd = &cobra.Command{
slogs.Logr.Fatal("Error loading config", "error", err)
}
client := github.NewClient(nil).WithAuthToken(cfg.GithubToken)
webhookURL := "https://alert-receiver.chiaops.com/devrel"
webhookURL := os.Getenv("KEYBASE_WEBHOOK_URL")
if webhookURL == "" {
slogs.Logr.Error("KEYBASE_WEBHOOK_URL environment variable is not set")
}

datastore, err := database.NewDatastore(
viper.GetString("db-host"),
Expand Down
1 change: 1 addition & 0 deletions k8s/notify-pending-prs.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ secretEnvironment:
GITHUB_BOT_DB_USER: "{{ DB_USER }}"
GITHUB_BOT_DB_PASS: "{{ DB_PASS }}"
GITHUB_BOT_DB_NAME: "github-bot"
KEYBASE_WEBHOOK_URL: "https://alert-receiver.chiaops.com/teambottesting"
WEBHOOK_AUTH_SECRET_TOKEN: "{{ WEBHOOK_AUTH_SECRET_TOKEN }}"

networkPolicy:
Expand Down
1 change: 1 addition & 0 deletions k8s/notify-stale-prs.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ secretEnvironment:
GITHUB_BOT_DB_USER: "{{ DB_USER }}"
GITHUB_BOT_DB_PASS: "{{ DB_PASS }}"
GITHUB_BOT_DB_NAME: "github-bot"
KEYBASE_WEBHOOK_URL: "https://alert-receiver.chiaops.com/devrel"
WEBHOOK_AUTH_SECRET_TOKEN: "{{ WEBHOOK_AUTH_SECRET_TOKEN }}"

networkPolicy:
Expand Down

0 comments on commit d57bd9a

Please sign in to comment.