configVersion: 1
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
name: Example Template
description: A template to clone a GitHub repository.
labels:
  - github
parameters:
  required: ["targetRepoName"]
  properties:
    targetRepoName:
      title: Repository name to clone to
      type: string

steps:
  - id: cloneRepo
    name: Clone Repository
    action: fetch:plain
    input:
      url: "https://github.com/atlassian-labs/compass-examples"
      targetPath: ./compass-examples

  - id: publishRepo
    name: Publish Repository
    action: publish:github
    input:
      repoUrl: "github.com?owner=<yourOrgName>&repo=${{ parameters.targetRepoName }}"
      repoVisibility: private
      sourcePath: ./template-website-simple

output:
  links:
    - url: "https://github.com/<yourOrgName>/${{ parameters.targetRepoName }}"
      title: "View Cloned Repository"
