Azure Repo Push

Action ID: azure:repo:push
NPM Package:

@parfuemerie-douglas/scaffolder-backend-module-azure-repositories

Description

Push the content in the workspace to a remote Azure repository.

Input Schema

PropertyTypeDescriptionRequired
branchstringThe branch to checkout to.
sourcePathstringThe subdirectory of the working directory containing the repository.
gitAuthorNamestringSets the default author name for the commit. The default value is 'Scaffolder'.
gitAuthorEmailstringSets the default author email for the commit.
gitCommitMessagestringSets the commit message on the repository. The default value is 'Initial commit'

Output Schema

No output schema defined for this action.

Usage Examples

Push initial commit to main with custom author

Push the first commit to the main branch after generating files with fetch:template. Use this when the remote is already configured and you want a custom author and message.

Copy
steps:
  - id: fetch-template
    action: fetch:template
    input:
      url: https://github.com/acme-org/service-template/archive/main.tar.gz
      targetPath: .
      values:
        name: ${{ parameters.serviceName }}
        owner: ${{ parameters.owner }}

  - id: push-initial
    action: azure:repo:push
    input:
      branch: main
      gitCommitMessage: "Initial commit for ${{ parameters.serviceName }}"
      gitAuthorName: "Scaffolder Bot"
      gitAuthorEmail: "scaffolder@acme.dev"

Push changes to a feature branch from a parameter

Push generated changes to a feature branch provided by the user after fetch:template. Use this when scaffolding should land on a non default branch for review.

Copy
steps:
  - id: fetch-template
    action: fetch:template
    input:
      url: ./skeleton
      targetPath: .
      values:
        component_id: ${{ parameters.componentId }}
        owner: ${{ parameters.owner }}

  - id: push-to-feature
    action: azure:repo:push
    input:
      branch: ${{ parameters.featureBranch }}
      gitCommitMessage: "chore: scaffold ${{ parameters.componentId }} on ${{ parameters.featureBranch }}"
      gitAuthorName: ${{ parameters.gitAuthorName }}
      gitAuthorEmail: ${{ parameters.gitAuthorEmail }}

Push only a subdirectory from a monorepo workspace

Push the contents of a subdirectory to the remote after populating the workspace with fetch:template. Use this when the repository is a monorepo and you generated files under a specific package path.

Copy
steps:
  - id: fetch-template
    action: fetch:template
    input:
      url: https://github.com/acme-org/monorepo-template/archive/main.tar.gz
      targetPath: .
      values:
        packageName: ${{ parameters.packageName }}
        owner: ${{ parameters.owner }}

  - id: push-package
    action: azure:repo:push
    input:
      branch: develop
      sourcePath: packages/${{ parameters.packageName }}
      gitCommitMessage: "feat: add package ${{ parameters.packageName }}"
      gitAuthorName: "Monorepo Bot"
      gitAuthorEmail: "monorepo-bot@acme.dev"

Push to a release branch using defaults

Push to a release branch and rely on the default author and commit message. Use this when you do not need to override defaults after fetch:template.

Copy
steps:
  - id: fetch-template
    action: fetch:template
    input:
      url: ./templates/service
      targetPath: .
      values:
        name: ${{ parameters.name }}
        owner: ${{ parameters.owner }}

  - id: push-release
    action: azure:repo:push
    input:
      branch: release/1.2.0

Push generated CI files with a conventional commit message

After generating CI and project files with fetch:template, push to main with a conventional commit message and explicit author. Use this when you want a clear history entry for automation.

Copy
steps:
  - id: fetch-template
    action: fetch:template
    input:
      url: https://github.com/acme-org/ci-template/archive/main.tar.gz
      targetPath: .
      values:
        serviceName: ${{ parameters.serviceName }}
        ciProvider: github
        owner: ${{ parameters.owner }}

  - id: push-ci-update
    action: azure:repo:push
    input:
      branch: main
      gitCommitMessage: "ci: add workflows for ${{ parameters.serviceName }}"
      gitAuthorName: "CI Generator"
      gitAuthorEmail: "ci-generator@acme.dev"