Skip to content

Commit

Permalink
only get the public ips
Browse files Browse the repository at this point in the history
  • Loading branch information
Jivings committed Mar 14, 2023
1 parent ede3a52 commit 0ab5999
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ try {
})
.then((drops) => {
console.log(`Found ${drops.length} matching droplets`);
return drops.map((d) => d.networks.v4[0].ip_address);
// find the public ips
return drops.map((d) => {
return d.networks.v4.find((i) => i.type === "public").ip_address;
});
})
.then((ips) => {
core.setOutput("server_ips", ips || []);
Expand Down

0 comments on commit 0ab5999

Please sign in to comment.