mirror of
https://github.com/deployphp/action.git
synced 2024-11-26 21:59:02 +00:00
Add self-hosted option to action (#52)
+ This skips over the SSH configuration part of the action. + This is because self-hosted runners would typically have SSH already running causing ssh-agent command to throw an error (process already exists/port in use)
This commit is contained in:
parent
e93a6158ef
commit
d12c16f961
@ -19,6 +19,10 @@
|
|||||||
# Required.
|
# Required.
|
||||||
dep: deploy
|
dep: deploy
|
||||||
|
|
||||||
|
# Option to skip over the SSH setup/configuration
|
||||||
|
# Self hosted runners don't need the SSH configuration or the SSH agent to be started
|
||||||
|
self-hosted: false
|
||||||
|
|
||||||
# Private key for connecting to remote hosts. To generate private key:
|
# Private key for connecting to remote hosts. To generate private key:
|
||||||
# `ssh-keygen -o -t rsa -C 'action@deployer.org'`.
|
# `ssh-keygen -o -t rsa -C 'action@deployer.org'`.
|
||||||
# Optional.
|
# Optional.
|
||||||
|
@ -8,6 +8,11 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
description: The command.
|
description: The command.
|
||||||
|
|
||||||
|
self-hosted:
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
description: Whether the action is running on a self-hosted runner.
|
||||||
|
|
||||||
private-key:
|
private-key:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
4
index.js
4
index.js
@ -12,6 +12,10 @@ void async function main() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
async function ssh() {
|
async function ssh() {
|
||||||
|
if (core.getBooleanInput('self-hosted')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let sshHomeDir = `${process.env['HOME']}/.ssh`
|
let sshHomeDir = `${process.env['HOME']}/.ssh`
|
||||||
|
|
||||||
if (!fs.existsSync(sshHomeDir)) {
|
if (!fs.existsSync(sshHomeDir)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user