Skip to content
shield

GitHub Action

OpenVPN 3 Action

v2.1 Latest version

OpenVPN 3 Action

shield

OpenVPN 3 Action

Using OpenVPN 3 to start a VPN session

Installation

Copy and paste the following snippet into your .yml file.

              

- name: OpenVPN 3 Action

uses: dbritto-dev/openvpn3-action@v2.1

Learn more about this action in dbritto-dev/openvpn3-action

Choose a version

OpenVPN 3 Action

This action starts a VPN session using OpenVPN 3 and give you the option to run any bash script during the session. We recommend you to store your config files in GitHub using encrypted secrets.

Note: this action only support linux (ubuntu). Please use one of the virtual environments for linux (ubuntu) supported by GitHub Actions.

Reference Links:

Usage

- uses: dbritto-dev/openvpn3-action@main
  with:
    # Description: OpenVPN 3 profile file (.ovpn/.conf).
    # Encoded: Base64
    # Required: true
    vpn-client-config: ""
    # Description: OpenVPN 3 Autoload config file (.autoload). If this input is provided we use
    # `openvpn3-autoload` instead of `openvpn3` to start the VPN session.
    # OpenVPN 3 does support `auth-user-pass` through `openvpn3-autoload` utility.
    # To read more about OpenVPN 3 and `auth-user-pass` go to https://openvpn.net/blog/openvpn-3-linux-and-auth-user-pass/
    # Encoded: Base64
    # Required: false
    # Default: ''
    vpn-autoload-config: ""
    # Description: Bash script to run after the session was started and before the session was closed.
    # Required: true
    script: |
      echo "Hello Developer!"

Scenarios

Using OpenVPN 3 profile

on: [push]

jobs:
  testing:
    runs-on: ubuntu-latest
    steps:
      - uses: dbritto-dev/openvpn3-action@main
        with:
          vpn-client-config: ${{ secrets.VPN_CLIENT_CONFIG }}
          script: |
            sudo openvpn3 sessions-list

Using OpenVPN 3 profile wih auth-user-pass

on: [push]

jobs:
  testing:
    runs-on: ubuntu-latest
    steps:
      - uses: dbritto-dev/openvpn3-action@main
        with:
          vpn-client-config: ${{ secrets.VPN_CLIENT_CONFIG }}
          vpn-autoload-config: ${{ secrets.VPN_AUTOLOAD_CONFIG }}
          script: |
            sudo openvpn3 sessions-list

Note: this approach should be deprecated soon. Please use do not use vpn-autoload-config anymore.

License

The scripts and documentation in this project are released under the MIT License