generator-github.yaml 1.4 KB

123456789101112131415161718192021222324
  1. # 1. Register Github app https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app#registering-a-github-app
  2. # `App ID: 123456` will be displayed after you create an app. Next on the bottom of the page, you'll find `Generate a private key` button.
  3. # 2. Get privateKey https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#generating-private-keys put it in e.g `github-app-pem` k8s secret
  4. # 3. Set permissions for the app, e.g if you want to push OCI images to ghr set RW for packages https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app#choosing-permissions-for-rest-api-access
  5. # 4. Install your Github app https://docs.github.com/en/apps/using-github-apps/installing-your-own-github-app
  6. # 5. Get `installID` https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app#generating-an-installation-access-token (2)
  7. ---
  8. apiVersion: generators.external-secrets.io/v1alpha1
  9. kind: GithubAccessToken
  10. metadata:
  11. name: github-auth-token
  12. spec:
  13. appID: "0000000" # (1)
  14. installID: "00000000" # (5)
  15. url: "" # (Default https://api.github.com.)
  16. repositories: # Optional
  17. - "Hello-World"
  18. permissions: # Optional
  19. contents: read
  20. auth:
  21. privateKey:
  22. secretRef:
  23. name: github-app-pem # (2)
  24. key: key