Renames files and directories within the workspace
Input Schema
| Property | Type | Description | Required |
|---|---|---|---|
| files | array | A list of file and directory names that will be renamed |
Output Schema
Usage Examples
Rename template directories and common files after fetching
Use this to rename a scaffolded service directory and normalize common files like README and env files. It runs after fetch:template and before publish:github.
steps:
- id: fetch-base
action: fetch:template
input:
url: https://github.com/example-org/software-templates/node-service
targetPath: .
values:
name: ${{ parameters.serviceName }}
owner: ${{ parameters.owner }}
- id: rename-files
action: fs:rename
input:
files:
- from: packages/service
to: services/${{ parameters.serviceName }}
- from: README.template.md
to: README.md
- from: .env.example
to: .env
- id: publish
action: publish:github
input:
repoUrl: github.com?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}
defaultBranch: mainMove and rename nested paths for environment-specific setup
Use this to reorganize nested directories and rename manifests based on environment input. It fits between fetch:template and a publish step like publish:github.
steps:
- id: fetch-template
action: fetch:template
input:
url: https://github.com/example-org/software-templates/k8s-service
targetPath: .
values:
appId: ${{ parameters.appId }}
env: ${{ parameters.environment }}
- id: move-and-rename
action: fs:rename
input:
files:
- from: apps/web
to: apps/${{ parameters.appId }}
- from: k8s/deployment.yaml
to: deploy/${{ parameters.environment }}/deployment.yaml
- from: k8s/service.yaml
to: deploy/${{ parameters.environment }}/service.yaml
- from: charts/app
to: charts/${{ parameters.appId }}
- id: publish
action: publish:github
input:
repoUrl: github.com?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}