Closed7
ArgoCD sync時にPRコメント

auto syncしてるアプリケーションがsyncされた時にPRコメントしたい

Application
にannotations
をつける
例:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
# sync成功時
notifications.argoproj.io/subscribe.on-deployed.github=argocd-notification-test

とりあえずPRコメントしたいだけなので、以下のような感じにしておく
メンションできるかもついでに確認
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
.....
template.app-deployed: |
message: |
Application {{.app.metadata.name}} is now running new version of deployments manifests.
github:
repoURLPath: "{{.app.spec.source.repoURL}}"
revisionPath: "{{.app.status.operationState.syncResult.revision}}"
pullRequestComment:
content: |
@omihirofumi hello

github apps

試してるレポジトリ

{{.app.metadata.name}}
でapplication名をとれる。
このスクラップは4ヶ月前にクローズされました