GitHub

Parameters

The GitHub notification service changes commit status using GitHub Apps and requires specifying the following settings:

  • appID - the app id
  • installationID - the app installation id
  • privateKey - the app private key
  • enterpriseBaseURL - optional URL, e.g. https://git.example.com/

Configuration

  1. Create a GitHub Apps using https://github.com/settings/apps/new
  2. Change repository permissions to enable write commit statuses 2
  3. Generate a private key, and download it automatically 3
  4. Install app to account
  5. Store privateKey in argocd-notifications-secret Secret and configure GitHub integration in argocd-notifications-cm ConfigMap
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: <config-map-name>
  5. data:
  6. service.github: |
  7. appID: <app-id>
  8. installationID: <installation-id>
  9. privateKey: $github-privateKey
  1. apiVersion: v1
  2. kind: Secret
  3. metadata:
  4. name: <secret-name>
  5. stringData:
  6. github-privateKey: |
  7. -----BEGIN RSA PRIVATE KEY-----
  8. (snip)
  9. -----END RSA PRIVATE KEY-----
  1. Create subscription for your GitHub integration
  1. apiVersion: argoproj.io/v1alpha1
  2. kind: Application
  3. metadata:
  4. annotations:
  5. notifications.argoproj.io/subscribe.<trigger-name>.github: ""

Templates

GitHub - 图3

If the message is set to 140 characters or more, it will be truncate.

  1. template.app-deployed: |
  2. message: |
  3. Application {{.app.metadata.name}} is now running new version of deployments manifests.
  4. github:
  5. status:
  6. state: success
  7. label: "continuous-delivery/{{.app.metadata.name}}"
  8. targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"