Fetch Plain Content

Action ID: fetch:plain
NPM Package:

@backstage/plugin-scaffolder-backend

Description

Downloads content and places it in the workspace, or optionally in a subdirectory specified by the targetPath input option.

Input Schema

PropertyTypeDescriptionRequired
urlstringRelative path or absolute URL pointing to the directory tree to fetch
tokenstringAn optional token to use for authentication when reading the resources.
targetPathstringTarget path within the working directory to download the contents to.

Output Schema

No output schema defined for this action.

Usage Examples

Fetch static base files from a local folder into the workspace root

Copies non-templated base files that live next to the template into the workspace. Use this to bring in common dotfiles or shared assets before you generate code or publish with publish:github.

Copy
steps:
  - id: fetch-base-files
    action: fetch:plain
    input:
      url: ./skeletons/base

Fetch documentation starter into a docs subdirectory

Downloads a docs starter from a local path and places it under docs. Useful when your template renders code separately and you want static documentation assets in a fixed location before registering with catalog:register.

Copy
steps:
  - id: fetch-docs-starter
    action: fetch:plain
    input:
      url: ./assets/docs-starter
      targetPath: docs

Download and extract a remote tarball into a vendor folder

Fetches a public tarball from a remote repository and extracts it under vendor. Use this to vendor a UI kit or boilerplate content before you commit or publish with publish:github.

Copy
steps:
  - id: fetch-remote-tarball
    action: fetch:plain
    input:
      url: https://codeload.github.com/acme/ui-kit/tar.gz/refs/tags/v2.4.1
      targetPath: vendor/ui-kit

Fetch from a private GitHub archive using a token

Downloads a private repository archive and places it under charts. Pass a token that can read the source, for example a PAT provided as a template parameter or secret.

Copy
steps:
  - id: fetch-private-charts
    action: fetch:plain
    input:
      url: https://codeload.github.com/acme-internal/helm-charts/zip/refs/heads/main
      targetPath: charts
      token: ${{ parameters.githubReadToken }}

Parameterized content selection for environment overlays

Selects which overlay to fetch using template parameters and writes it to a specific location. Use this to pull environment specific k8s overlays before you publish or push changes.

Copy
steps:
  - id: fetch-env-overlay
    action: fetch:plain
    input:
      url: ${{ parameters.overlaySource }}        # e.g. ./overlays/dev or ./overlays/prod
      targetPath: ${{ parameters.overlayTarget }} # e.g. deploy/overlays/dev

Other actions in @backstage/plugin-scaffolder-backend