Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:Générer une URL de dépôt Git : ACS::GitCodeRepo

Dernière mise à jour :Aug 11, 2026

Utilisation

Génère une URL pour le code d’un dépôt GitHub ou Gitee spécifié.

Syntaxe

Tasks:
  - Name: GitCodeRepo
    Action: ACS::GitCodeRepo
    Description: Specifies the code source and generates a temporary authorization link.
    Properties:
      Platform: github # Required. The platform. Valid values: github, gitee.
      Owner: your-github-user-name # Required. The GitHub account name.
      Organization: your-github-organization # Optional. The organization name.
      Repository: your-github-repository # Required. The repository name.
    Outputs:
      authorizedUrl: # The URL of the code in the specified GitHub or Gitee repository.
        Type: String
        ValueSelector: AuthorizedUrl # The jq selector syntax. The task's return value is used as the JSON input. For more information about the jq syntax, see https://stedolan.github.io/jq.

Remarques

  • Accordez les autorisations avant utilisation. Lors de la création d’un modèle ou de l’exécution d’une tâche, suivez les instructions à l’écran pour finaliser l’autorisation.

  • Le résultat est une URL, par exemple :

https://your_***@github.com/owner/repo

Utilisez cette URL pour cloner le code. Exemple :

git clone https://your_***@github.com/owner/repo .

Exemple

FormatVersion: OOS-2019-06-01
Parameters:
  instanceId:
    Description: the instance id that you will start.
    Type: String
Tasks:
  - Name: GitCodeRepo
    Action: ACS::GitCodeRepo
    Description: Specifies the code source and generates a temporary authorization link.
    Properties:
      Platform: github
      Owner: your-github-user-name
      Organization: your-github-organization
      Repository: your-github-repository
    Outputs:
      authorizedUrl:
        Type: String
        ValueSelector: AuthorizedUrl
  - Name: CloneCode
    Action: ACS::ECS::RunCommand
    Description:
      en: Execute clone code command
      zh-cn: Execute the clone code command
    Properties:
      instanceId: '{{ instanceId }}'
      commandType: RunShellScript
      commandContent: |-
        git clone '{{ GitCodeRepo.authorizedUrl }}' .