apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: forgejo-access-token
  namespace: argocd 
spec:
  secretStoreRef:
    name: gitea
    kind: ClusterSecretStore
  refreshInterval: "0"
  target:
    name: forgejo-access-token
    template:
      engineVersion: v2
      data:
        forgejo_username: "{{.FORGEJO_ACCESS_USERNAME}}"
        forgejo_token: "{{.FORGEJO_ACCESS_TOKEN}}"
      metadata:
        labels:
          app.kubernetes.io/part-of: argocd
  data:
    - secretKey: FORGEJO_ACCESS_USERNAME
      remoteRef:
        key: forgejo-access-token
        property: username
    - secretKey: FORGEJO_ACCESS_TOKEN
      remoteRef:
        key: forgejo-access-token
        property: token
