docs/operator-manual/notifications/services/github.md
The GitHub notification service changes commit status using GitHub Apps and requires specifying the following settings:
appID - the app idinstallationID - the app installation idprivateKey - the app private keyenterpriseBaseURL - optional URL, e.g. https://git.example.com/api/v3maxIdleConns - optional, maximum number of idle (keep-alive) connections across all hosts.maxIdleConnsPerHost - optional, maximum number of idle (keep-alive) connections per host.maxConnsPerHost - optional, maximum total connections per host.idleConnTimeout - optional, maximum amount of time an idle (keep-alive) connection will remain open before closing.⚠️ NOTE: Specifying
/api/v3in theenterpriseBaseURLis required until argoproj/notifications-engine#205 is resolved.
argocd-notifications-secret Secret and configure GitHub integration
in argocd-notifications-cm ConfigMapapiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
service.github: |
appID: <app-id>
installationID: <installation-id>
privateKey: $github-privateKey
apiVersion: v1
kind: Secret
metadata:
name: <secret-name>
stringData:
github-privateKey: |
-----BEGIN RSA PRIVATE KEY-----
(snip)
-----END RSA PRIVATE KEY-----
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
notifications.argoproj.io/subscribe.<trigger-name>.github: ""
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}}"
status:
state: success
label: "continuous-delivery/{{.app.metadata.name}}"
targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
deployment:
state: success
environment: production
environmentURL: "https://{{.app.metadata.name}}.example.com"
logURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
requiredContexts: []
autoMerge: true
transientEnvironment: false
reference: v1.0.0
pullRequestComment:
content: |
Application {{.app.metadata.name}} is now running new version of deployments manifests.
See more here: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true
commentTag: "continuous-delivery/{{.app.metadata.name}}"
checkRun:
name: "continuous-delivery/{{.app.metadata.name}}"
details_url: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
status: completed
conclusion: success
started_at: "YYYY-MM-DDTHH:MM:SSZ"
completed_at: "YYYY-MM-DDTHH:MM:SSZ"
output:
title: "Deployment of {{.app.metadata.name}} on ArgoCD"
summary: "Application {{.app.metadata.name}} is now running new version of deployments manifests."
text: |
Application {{.app.metadata.name}} is now running new version of deployments manifests.
See more here: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true
Notes:
github.repoURLPath and github.revisionPath are same as above, they can be omitted.true by default for github deployments to ensure the requested ref is up to date with the default branch.
Setting this option to false is required if you would like to deploy older refs in your default branch.
For more information see the GitHub Deployment API Docs.github.pullRequestComment.content is set to 65536 characters or more, it will be truncated.github.pullRequestComment.commentTag parameter is used to identify the comment. If a comment with the specified tag is found, it will be updated (upserted). If no comment with the tag is found, a new comment will be created.The method for generating commit statuses allows a maximum of 1000 attempts using the same commit SHA and context. Once this limit is reached, the API returns validation errors (HTTP 422). The notification engine ignores these errors and marks the notification attempts as completed.