forked from Twingate/github-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
28 lines (28 loc) · 1017 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: 'Connect to Twingate'
description: 'Connects to Twingate protected resources from your Github Action workflow'
branding:
icon: 'arrow-right-circle'
color: 'black'
inputs:
service-key:
description: 'Twingate Service Key'
required: true
runs:
using: "composite"
steps:
- name: Install Twingate
shell: bash
run: |
echo "deb [trusted=yes] https://packages.twingate.com/apt/ /" | sudo tee /etc/apt/sources.list.d/twingate.list
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/twingate.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
sudo apt install -yq twingate
- name: Setup and start Twingate
shell: bash
run: |
echo '${{ inputs.service-key }}' | sudo twingate setup --headless=-
sudo twingate start
TWINGATE_STATUS=$(sudo twingate status)
if [[ "$TWINGATE_STATUS" != 'online' ]]; then
echo "Exiting with error as Twingate is not connected"
exit 1
fi