name: "Setup OneConfig"
description: "OneConfig Personal Configuration"
author: VelocityLight

inputs:
  GIT_ACTION_BOT:
    required: true
    description: "Token used to manage branch [environment variable]"
  namespace:
    required: true
    description: "The target namespace to initialize the ingresses."
  source_branch:
    required: false
    description: "The source configuration branch"
    default: dev
  oneconfig_repo:
    required: false
    description: "The oneconfig repository"
    default: "tidbcloud/oneconfig"

runs:
  using: "composite"
  steps:
    - name: Create or Update Oneconfig Branch
      working-directory: cicd-core/components/env-dev/dev-oneconfig
      env:
        TARGET_BRANCH: personal/${{ inputs.namespace }}
      run: |
        bash create_branch.sh ${{ env.TARGET_BRANCH }} ${{ inputs.source_branch }} ${{ inputs.oneconfig_repo }} ${{ inputs.GIT_ACTION_BOT }}
      shell: bash
