Compare commits

...

4 Commits

Author SHA1 Message Date
Måns Andersson
e923ff605c Merge 3405be3b42 into cf583aab4f 2023-08-03 15:46:41 -04:00
Dragan Filipović
cf583aab4f Merge pull request #153 from Triloworld/patch-2
Update README.md
2023-08-03 19:18:58 +02:00
Måns Andersson
3405be3b42 Normalize line endings in SSH key for the underlying OS 2023-07-26 12:36:40 +02:00
Patryk Padus
e7f0312c8c Update README.md
In reference of this issue and comment: https://github.com/easingthemes/ssh-deploy/issues/149
2023-06-23 14:52:23 +02:00
5 changed files with 19 additions and 6 deletions

View File

@@ -83,7 +83,7 @@ or use the latest version from a branch, eg: ssh-deploy@main
```
- name: Deploy to Staging server
uses: easingthemes/ssh-deploy@main
env:
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "dist/"
@@ -124,7 +124,7 @@ jobs:
run: npm run build --if-present
- name: Deploy to Server
uses: easingthemes/ssh-deploy@main
env:
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "dist/"

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

15
package-lock.json generated
View File

@@ -1,14 +1,15 @@
{
"name": "@draganfilipovic/ssh-deploy",
"version": "4.1.7",
"version": "4.1.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@draganfilipovic/ssh-deploy",
"version": "4.1.7",
"version": "4.1.8",
"license": "MIT",
"dependencies": {
"os": "^0.1.2",
"rsyncwrapper": "^3.0.1"
},
"devDependencies": {
@@ -1483,6 +1484,11 @@
"node": ">= 0.8.0"
}
},
"node_modules/os": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/os/-/os-0.1.2.tgz",
"integrity": "sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ=="
},
"node_modules/p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
@@ -3061,6 +3067,11 @@
"word-wrap": "^1.2.3"
}
},
"os": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/os/-/os-0.1.2.tgz",
"integrity": "sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ=="
},
"p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",

View File

@@ -30,6 +30,7 @@
},
"homepage": "https://github.com/easingthemes/ssh-deploy#readme",
"dependencies": {
"os": "^0.1.2",
"rsyncwrapper": "^3.0.1"
},
"devDependencies": {

View File

@@ -1,6 +1,7 @@
const { join } = require('path');
const { execSync } = require('child_process');
const { writeToFile } = require('./helpers');
const { EOL } = require('os');
const KNOWN_HOSTS = 'known_hosts';
const getPrivateKeyPath = (filename = '') => {
@@ -19,7 +20,7 @@ const addSshKey = (content, deployKeyName) => {
const { dir, filename } = getPrivateKeyPath(deployKeyName);
writeToFile({ dir, filename: KNOWN_HOSTS, content: '' });
console.log('✅ [SSH] known_hosts file ensured', dir);
writeToFile({ dir, filename, content: `${content}\r\n`, isRequired: true, mode: '0400' });
writeToFile({ dir, filename, content: `${content}${EOL}`, isRequired: true, mode: '0400' });
console.log('✅ [SSH] key added to `.ssh` dir ', dir, filename);
};