27 Commits

Author SHA1 Message Date
dependabot[bot]
9ba62064d2 chore(deps): bump tj-actions/changed-files from 43 to 44 (#171)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 43 to 44.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v43...v44)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-06 08:11:24 +08:00
dependabot[bot]
f314a5399e chore(deps): bump tj-actions/changed-files from 42 to 43 (#170)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 42 to 43.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v42...v43)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 09:42:58 +08:00
dependabot[bot]
699fa1181c chore(deps): bump tj-actions/changed-files from 41 to 42 (#165)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 41 to 42.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v41...v42)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-27 11:08:08 +08:00
Ilya Brin
9f34cc3e55 docs(readme): update dependency in example (#159)
Bumped GitHub Actions in README
2024-01-01 13:46:55 +08:00
Bo-Yi Wu
917f8b81df chore: update dependencies and improve compatibility with latest versions
Some checks failed
scp files / test scp action (push) Failing after 7s
scp files / test deploy artifact (push) Failing after 4s
scp files / test changed-files (push) Failing after 4s
scp files / test target folder (push) Failing after 7s
scp files / test Multiple Host (push) Failing after 6s
- Update the version of `appleboy/scp-action` from `v0.1.6` to `v0.1.7`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-01-01 13:45:26 +08:00
Bo-Yi Wu
78e7f475f3 chore: update base image in Dockerfile to version 1.6.14
- Update the base image from `1.6.13` to `1.6.14` in the Dockerfile

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-01-01 13:44:54 +08:00
Bo-Yi Wu
dfde1f50eb chore: refine CI/CD workflows and tests configuration
- Update `appleboy/scp-action` version from `v0.1.5` to `v0.1.6` in README examples

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-12-26 14:48:33 +08:00
Bo-Yi Wu
35093a99f9 chore: update drone-scp image to v1.6.13 (#158)
Some checks failed
scp files / test scp action (push) Failing after 8s
scp files / test deploy artifact (push) Failing after 4s
scp files / test changed-files (push) Failing after 9s
scp files / test target folder (push) Failing after 10s
scp files / test Multiple Host (push) Failing after 7s
- Update the drone-scp image from version `1.6.12` to `1.6.13` in the Dockerfile

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-12-26 13:54:08 +08:00
dependabot[bot]
96947ea2bd chore(deps): bump tj-actions/changed-files from 37 to 41 (#156)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 37 to 41.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v37...v41)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 10:40:41 +08:00
dependabot[bot]
aef31a66e3 chore(deps): bump actions/upload-artifact from 3 to 4 (#157)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 10:40:20 +08:00
dependabot[bot]
950981a11d chore(deps): bump actions/download-artifact from 3 to 4 (#155)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 10:39:54 +08:00
appleboy
5878fc908f chore: update appleboy/scp-action to v0.1.5
Some checks failed
scp files / test scp action (push) Failing after 6s
scp files / test deploy artifact (push) Failing after 9s
scp files / test changed-files (push) Failing after 4s
scp files / test target folder (push) Failing after 5s
scp files / test Multiple Host (push) Failing after 13s
- Update the version of `appleboy/scp-action` from `v0.1.4` to `v0.1.5`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-12-25 21:54:17 +08:00
Bo-Yi Wu
abb6d70bee chore: update drone-scp to v1.6.12 version (#154)
* chore: update Dockerfile and CI configuration

- Remove unnecessary steps in the `testing` job in `ci.yml`
- Update the base image in `Dockerfile` to version 1.6.12
- Change the location of the `entrypoint.sh` file in `Dockerfile`

Signed-off-by: appleboy <appleboy.tw@gmail.com>

* update

Signed-off-by: appleboy <appleboy.tw@gmail.com>

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-12-25 21:52:55 +08:00
dependabot[bot]
b03ad1c124 chore(deps): bump actions/checkout from 3 to 4 (#141)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-24 21:00:40 +08:00
dependabot[bot]
d398e64fcf chore(deps): bump tj-actions/changed-files from 37 to 40 (#147)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 37 to 40.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v37...v40)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-24 21:00:17 +08:00
dependabot[bot]
3710327b67 chore(deps): bump tj-actions/changed-files from 36 to 37 (#129)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-21 22:51:58 +08:00
appleboy
d47d818ab7 docs: improve OpenSSH setup and usage instructions
- Corrected a typo in the instructions for changing the default OpenSSH shell to git bash
- Added instructions to set `tar_dereference` and `rm` variable to `true` in the YAML file
- Advised against putting the `port` value through a variable
- Provided guidance on converting the target path to a Unix path: `/c/path/to/target/`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-07-21 22:49:16 +08:00
Luxoruus
7435be3541 docs: Adding further instructions to Windows server users (#132) 2023-07-21 22:45:39 +08:00
dependabot[bot]
11da0c97f9 chore(deps): bump tj-actions/changed-files from 35 to 36 (#126)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 35 to 36.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v35...v36)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-07 11:20:18 +08:00
Ilya Brin
ec73feb854 Update README.md (#125) 2023-05-20 14:56:25 +08:00
m5chm3lz3r
cdeb36bbf9 Update README.md (#123) 2023-05-20 14:56:03 +08:00
Bo-Yi Wu
c209399d24 chore: update Docker image for drone-scp to version 1.6.10 (#116)
- Update the `drone-scp` Docker image from version `1.6.9` to `1.6.10`

fix https://github.com/appleboy/scp-action/issues/112
2023-04-16 12:16:16 +08:00
Bo-Yi Wu
952a6e3250 ci: refactor CI workflow to support multiple hosts (#115)
- Add a new job to copy files to multiple hosts in the CI workflow

fix https://github.com/appleboy/scp-action/issues/98
2023-04-16 11:44:14 +08:00
Bo-Yi Wu
82ebdbe3ed feat: support folder name contain space keyword (#110)
- Rename a workflow job from `deploy artifact` to `test deploy artifact`
- Add a new workflow job for copying files to a server

ref https://github.com/appleboy/scp-action/issues/85
2023-04-15 08:32:05 +08:00
dependabot[bot]
2cd029d317 chore(deps): bump actions/download-artifact from 2 to 3 (#109)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 11:05:43 +08:00
Bo-Yi.Wu
e0dbae8ff0 chore: update target field path in multiple files
- Change the `target` field value from `&#34;test&#34;` to `your_server_target_folder_path` in multiple places in the file.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 18:30:02 +08:00
Bo-Yi.Wu
3e84ad0651 chore: update GitHub Actions and dependencies
- Update the GitHub Actions `checkout` and `scp-action` versions.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 18:28:00 +08:00
3 changed files with 208 additions and 166 deletions

View File

@@ -1,13 +1,12 @@
name: scp files
on: [push]
jobs:
testing:
name: test scp action
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: copy file via ssh password
uses: ./
@@ -63,43 +62,21 @@ jobs:
target: "test"
use_insecure_cipher: true
- name: correct key but wrong password
uses: appleboy/scp-action@7af00892de6f8397c5c3393cfb3b32ae7f91b94b
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
password: abcdefg
port: ${{ secrets.PORT }}
source: "tests/a.txt,tests/b.txt"
target: "test"
- name: correct password but wrong key
uses: appleboy/scp-action@7af00892de6f8397c5c3393cfb3b32ae7f91b94b
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: abcdefg
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "tests/a.txt,tests/b.txt"
target: "test"
deploy:
name: deploy artifact
name: test deploy artifact
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: echo hello > world.txt
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: world.txt
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: my-artifact
path: distfiles
@@ -119,11 +96,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: true
separator: ","
@@ -137,3 +114,37 @@ jobs:
port: ${{ secrets.PORT }}
source: ${{ steps.changed-files.outputs.all_changed_files }}
target: test
target:
name: test target folder
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: copy file to server
uses: ./
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: tests/a.txt,tests/b.txt
target: foobar foobar 1234
multipleHost:
name: test Multiple Host
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: copy file to server
uses: ./
with:
host: ${{ secrets.HOST }}:${{ secrets.PORT }},${{ secrets.HOST }}:${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: 1024
source: tests/a.txt,tests/b.txt
target: foobar

View File

@@ -1,5 +1,5 @@
FROM ghcr.io/appleboy/drone-scp:1.6.7
FROM ghcr.io/appleboy/drone-scp:1.6.14
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
COPY entrypoint.sh /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]

131
README.md
View File

@@ -19,16 +19,16 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: copy file via ssh password
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "tests/a.txt,tests/b.txt"
target: "test"
target: your_server_target_folder_path
```
## Input variables
@@ -137,48 +137,48 @@ Copy file via a SSH password:
```yaml
- name: copy file via ssh password
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: example.com
username: foo
password: bar
port: 22
source: "tests/a.txt,tests/b.txt"
target: "test"
target: your_server_target_folder_path
```
Copy file via a SSH key:
```yaml
- name: copy file via ssh key
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
source: "tests/a.txt,tests/b.txt"
target: "test"
target: your_server_target_folder_path
```
Example configuration for ignore list:
```yaml
- name: copy file via ssh key
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
source: "tests/*.txt,!tests/a.txt"
target: "test"
target: your_server_target_folder_path
```
Example configuration for multiple servers:
```diff
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
- host: "example.com"
+ host: "foo.com,bar.com"
@@ -186,13 +186,13 @@ Example configuration for multiple servers:
password: bar
port: 22
source: "tests/a.txt,tests/b.txt"
target: "test"
target: your_server_target_folder_path
```
Example configuration for exclude custom files:
```yaml
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: "example.com"
username: foo
@@ -200,7 +200,7 @@ Example configuration for exclude custom files:
port: 22
- source: "tests/*.txt"
+ source: "tests/*.txt,!tests/a.txt,!tests/b.txt"
target: "test"
target: your_server_target_folder_path
```
Upload artifact files to remote server:
@@ -211,74 +211,46 @@ Upload artifact files to remote server:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: echo hello > world.txt
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: world.txt
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: my-artifact
path: distfiles
- name: copy file to server
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: distfiles/*
target: test
target: your_server_target_folder_path
```
Remove the specified number of leading path elements:
```yaml
- name: remove the specified number of leading path elements
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: "tests/a.txt,tests/b.txt"
target: "foobar"
target: your_server_target_folder_path
strip_components: 1
```
Only copy files that are newer than the corresponding destination files:
```yaml
changes:
name: test changed-files
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
since_last_remote_commit: true
separator: ","
- name: copy file to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: ${{ steps.changed-files.outputs.all_changed_files }}
target: test
```
Old target structure:
```sh
@@ -296,11 +268,39 @@ foobar
└── b.txt
```
Only copy files that are newer than the corresponding destination files:
```yaml
changes:
name: test changed-files
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
since_last_remote_commit: true
separator: ","
- name: copy file to server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: ${{ steps.changed-files.outputs.all_changed_files }}
target: your_server_target_folder_path
```
Protecting a Private Key. The purpose of the passphrase is usually to encrypt the private key. This makes the key file by itself useless to an attacker. It is not uncommon for files to leak from backups or decommissioned hardware, and hackers commonly exfiltrate files from compromised systems.
```diff
- name: ssh key with passphrase
uses: appleboy/scp-action@master
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@@ -308,5 +308,36 @@ Protecting a Private Key. The purpose of the passphrase is usually to encrypt th
+ passphrase: ${{ secrets.PASSPHRASE }}
port: ${{ secrets.PORT }}
source: "tests/a.txt,tests/b.txt"
target: "test"
target: your_server_target_folder_path
```
When copying files from a Linux runner to a Windows server, you should:
1. Download git for Windows
2. Change the default OpenSSH shell to git bach with the following powershell command.
3. Set `tar_dereference` and `rm` variable to `true` in the YAML file
4. Avoid putting the `port` value through a variable
5. Convert the target path to a Unix path: `/c/path/to/target/`
Change the default OpenSSH shell to git bach with the following powershell command.
```powershell
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "$env:Programfiles\Git\bin\bash.exe" -PropertyType String -Force
```
Convert the target path to a Unix path: `/c/path/to/target/`
```diff
- name: Copy to Windows
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
source: 'your_source_path'
- target: 'C:\path\to\target'
+ target: '/c/path/to/target/'
+ tar_dereference: true
+ rm: true
```