docs: add example
This commit is contained in:
parent
5138976c70
commit
6fd371aeaf
3 changed files with 46 additions and 0 deletions
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
|
@ -26,3 +26,14 @@ jobs:
|
||||||
port: ${{ secrets.PORT }}
|
port: ${{ secrets.PORT }}
|
||||||
source: "tests/a.txt,tests/b.txt"
|
source: "tests/a.txt,tests/b.txt"
|
||||||
target: "test"
|
target: "test"
|
||||||
|
|
||||||
|
- name: remove the specified number of leading path elements
|
||||||
|
uses: appleboy/scp-action@master
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.HOST }}
|
||||||
|
username: ${{ secrets.USERNAME }}
|
||||||
|
key: ${{ secrets.KEY }}
|
||||||
|
port: ${{ secrets.PORT }}
|
||||||
|
source: "tests/a.txt,tests/b.txt"
|
||||||
|
target: "foobar"
|
||||||
|
strip_components: 1
|
||||||
|
|
33
README.md
33
README.md
|
@ -37,6 +37,7 @@ see the [action.yml](./action.yml) file for more detail imformation.
|
||||||
* target - target path on the server
|
* target - target path on the server
|
||||||
* source - scp file list
|
* source - scp file list
|
||||||
* rm - remove target folder before upload data
|
* rm - remove target folder before upload data
|
||||||
|
* strip_components - remove the specified number of leading path elements.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@ -98,3 +99,35 @@ Example configuration for multiple server
|
||||||
source: "tests/a.txt,tests/b.txt"
|
source: "tests/a.txt,tests/b.txt"
|
||||||
target: "test"
|
target: "test"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
remove the specified number of leading path elements
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: remove the specified number of leading path elements
|
||||||
|
uses: appleboy/scp-action@master
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.HOST }}
|
||||||
|
username: ${{ secrets.USERNAME }}
|
||||||
|
key: ${{ secrets.KEY }}
|
||||||
|
port: ${{ secrets.PORT }}
|
||||||
|
source: "tests/a.txt,tests/b.txt"
|
||||||
|
target: "foobar"
|
||||||
|
strip_components: 1
|
||||||
|
```
|
||||||
|
|
||||||
|
old target structure:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
foobar
|
||||||
|
└── tests
|
||||||
|
├── a.txt
|
||||||
|
└── b.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
new target structure:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
foobar
|
||||||
|
├── a.txt
|
||||||
|
└── b.txt
|
||||||
|
```
|
||||||
|
|
|
@ -24,6 +24,8 @@ inputs:
|
||||||
description: 'scp file list'
|
description: 'scp file list'
|
||||||
rm:
|
rm:
|
||||||
description: 'remove target folder before upload data'
|
description: 'remove target folder before upload data'
|
||||||
|
strip_components:
|
||||||
|
description: 'remove the specified number of leading path elements'
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
|
Loading…
Reference in a new issue