我正在按照文檔獲取 Slack 機器人,以使用在Google Cloud Builder Community中找到的 Slack 圖像報告 Google Cloud Platform 中項目的 Cloud Build 進度。我已經能夠成功發布開箱即用的消息。由于我有多個要構建的存儲庫,因此我想發布正在構建的存儲庫的名稱:例如Build bot: Repo Fizz-buzz built successfully...Build bot: Repo Wizz-bang failed to build...在Notify()函數中,cloudbuild.Build結構有一些屬性可以做我想要的??雌饋砗芾硐?,Source.RepoSource.RepoName但它是零。另一種選擇是讓trigger()函數添加存儲庫名稱作為參數:Args: []string{ fmt.Sprintf("--build=%s", build), fmt.Sprintf("--webhook=%s", webhook), fmt.Sprintf("--repoName=%s", repoName), "--mode=monitor", },我寧愿讓 Notify() 函數處理這個問題,但我還沒有找到合適的結構屬性。是否有我可以在notify()函數期間使用的屬性來傳遞存儲庫名稱?
- 1 回答
- 0 關注
- 126 瀏覽
添加回答
舉報
0/150
提交
取消
