Skip to content

Commit 2aed7a4

Browse files
committed
define inputs in the re-usable action
1 parent 0b5f358 commit 2aed7a4

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

.github/actions/setup-warp/action.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@ author: 'ipspot@openscilab.com'
44

55
inputs:
66
mode:
7-
description: 'Choose WARP mode: client or wireguard'
7+
description: Choose WARP mode: client or wireguard
8+
required: false
9+
default: client
10+
11+
wg_private_key:
12+
description: WireGuard private key
13+
required: false
14+
15+
wg_peer_public_key:
16+
description: WireGuard peer public key
17+
required: false
18+
19+
wg_endpoint:
20+
description: WireGuard endpoint IP and port
821
required: false
9-
default: 'client'
1022

1123
runs:
1224
using: "composite"
@@ -48,7 +60,7 @@ runs:
4860
sudo apt-get -y install --no-install-recommends net-tools iproute2 openresolv dnsutils iptables wireguard-tools
4961
LAN=$(ip route get 192.168.193.10 | grep -oP 'src \K\S+')
5062
echo "[Interface]
51-
PrivateKey = ${{ secrets.WARP_WG_PRIVATE_KEY }}
63+
PrivateKey = ${{ inputs.wg_private_key }}
5264
Address = 172.16.0.2/32
5365
Address = fd01:5ca1:ab1e:823e:e094:eb1c:ff87:1fab/128
5466
PostUp = ip -4 rule add from $LAN lookup main
@@ -57,10 +69,10 @@ runs:
5769
MTU = 1280
5870
5971
[Peer]
60-
PublicKey = ${{ secrets.WARP_WG_PEER_PUBLIC_KEY }}
72+
PublicKey = ${{ inputs.wg_peer_public_key }}
6173
AllowedIPs = 0.0.0.0/0
6274
AllowedIPs = ::/0
63-
Endpoint = ${{ secrets.WARP_WG_ENDPOINT }}" | sed "s/^[ ]\+//g" | sudo tee /etc/wireguard/warp.conf
75+
Endpoint = ${{ inputs.wg_endpoint }}" | sed "s/^[ ]\+//g" | sudo tee /etc/wireguard/warp.conf
6476
sudo wg-quick up warp
6577
6678
else

0 commit comments

Comments
 (0)