Skip to main content

Husarnet Github Action Usage

info

Supported runners hosted by GitHub: ubuntu-18.04, ubuntu-20.04, ubuntu-latest

To use Husarnet in your GitHub workflow, create a .github/workflows/my-husarnet-workflow.yml file with the following content in your GitHub repository:

name: Ping other peer from a VPN network

on: push

jobs:
build:
runs-on: ubuntu-20.04
steps:

- name: Connecting to Husarnet VPN network
uses: husarnet/husarnet-action@v1
with:
join-code: ${{ secrets.HUSARNET_JOINCODE }}

- name: Ping other peer
run: ping6 -c 10 my-laptop

- name: Stop husarnet
run: sudo systemctl stop husarnet

Create a new GitHub secret: HUSARNET_JOINCODE and place your Join Code there.

Now after each commit, my-laptop device (we assume that it is in the same Husarnet network) will be pinged 10 times.