Skip to content

Commit f54a812

Browse files
committed
Fix host param of isPortReachable
1 parent c5604f7 commit f54a812

4 files changed

Lines changed: 25 additions & 13 deletions

File tree

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ inputs:
3232
floating-ip-assignment-timeout:
3333
description: "Gives Hetzner some time (in Ms) to assign an IP to a server."
3434
required: false
35-
default: 30000
35+
default: 60000
3636

3737
runs:
3838
using: 'node12'

dist/clean/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,20 @@ async function deploy() {
7878
core.exportVariable("SERVER_ID", body.server.id);
7979
core.exportVariable("SERVER_IPV4", ipv4);
8080

81-
const fn = async () =>
82-
await isPortReachable(config.DEFAULT_PORT, {
83-
ipv4
81+
const fn = () => {
82+
core.debug(
83+
`Trying to connect to server on default port "${config.DEFAULT_PORT}"`
84+
);
85+
return isPortReachable(config.DEFAULT_PORT, {
86+
host: ipv4
8487
});
88+
};
8589

8690
let online;
87-
8891
try {
8992
online = await periodicExecution(fn, true, options.timeout);
9093
} catch (err) {
94+
core.error(err.toString());
9195
if (err instanceof TimeoutError) {
9296
online = false;
9397
} else {

dist/deploy/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,20 @@ async function deploy() {
8383
core.exportVariable("SERVER_ID", body.server.id);
8484
core.exportVariable("SERVER_IPV4", ipv4);
8585

86-
const fn = async () =>
87-
await isPortReachable(config.DEFAULT_PORT, {
88-
ipv4
86+
const fn = () => {
87+
core.debug(
88+
`Trying to connect to server on default port "${config.DEFAULT_PORT}"`
89+
);
90+
return isPortReachable(config.DEFAULT_PORT, {
91+
host: ipv4
8992
});
93+
};
9094

9195
let online;
92-
9396
try {
9497
online = await periodicExecution(fn, true, options.timeout);
9598
} catch (err) {
99+
core.error(err.toString());
96100
if (err instanceof TimeoutError) {
97101
online = false;
98102
} else {

lib.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,20 @@ async function deploy() {
4949
core.exportVariable("SERVER_ID", body.server.id);
5050
core.exportVariable("SERVER_IPV4", ipv4);
5151

52-
const fn = async () =>
53-
await isPortReachable(config.DEFAULT_PORT, {
54-
ipv4
52+
const fn = () => {
53+
core.debug(
54+
`Trying to connect to server on default port "${config.DEFAULT_PORT}"`
55+
);
56+
return isPortReachable(config.DEFAULT_PORT, {
57+
host: ipv4
5558
});
59+
};
5660

5761
let online;
58-
5962
try {
6063
online = await periodicExecution(fn, true, options.timeout);
6164
} catch (err) {
65+
core.error(err.toString());
6266
if (err instanceof TimeoutError) {
6367
online = false;
6468
} else {

0 commit comments

Comments
 (0)