# Token for a GitLab CI workload.
# The system:bot role requires botName. Configure that bot's impersonation role
# separately so it can request the RBAC roles the job needs.
apiVersion: almaforge.com/v1
kind: Token
metadata:
  name: ci-platform-deploy # CI job ALMA_CLIENT_ID value.
spec:
  roles:
    - system:bot # CI jobs join as bots, then impersonate allowed RBAC roles.
  botName: ci-platform-deploy # Existing Bot resource this token is scoped to.
  gitlab:
    # domain: gitlab.example.com # Defaults to gitlab.com.
    allow:
      - projectPath: platform/deploy # group/project, with glob support.
        ref: main # Git ref the job must run on.
        refType: branch # Accepted values are branch or tag.
        refProtected: true # Only protected branches or tags may join.
        environment: production # GitLab environment name.
        pipelineSource: push # Pipeline source claim, such as push.
