GitHub Action
Border0 Connect
Border0 action companion for debugging in GitHub Actions.
To get started with this action, you'll need to register a Border0 account, and generate an admin token
by going to Border0 Admin Portal -> Organization Settings -> Access Tokens, create a token in Admin
permission groups,
and then add the token in your GitHub repository's secrets.
NOTE: Be sure to configure a timeout, as the default GitHub action timeout is set to 360 minutes (6 hours).
name: My Workflow
on: [push]
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Border0 action
uses: borderzero/gh-action@v1
with:
token: ${{ secrets.BORDER0_ADMIN_TOKEN }}
timeout-minutes: 15
Once the Setup Border0 action
has been run, a Border0 SSH socket will be created. It will then appear on the Sockets
page
in the Border0 Admin Portal.
The name of the SSH debug socket will follow this naming convention:
{github-org-name}-{github-repo-name}-{github-workflow-run-id}
Add if: ${{ failure() }}
to your Border0 action, and the action will only be triggered when previous steps in the job fail.
name: My Workflow
on: [push]
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Border0 action
if: ${{ failure() }}
uses: borderzero/gh-action@v1
with:
token: ${{ secrets.BORDER0_ADMIN_TOKEN }}
timeout-minutes: 15
Add slack-webhook-url
to the with
section of the Border0 action step. Doing so will enable the action to send
you a Slack message when the Border0 action is triggered.
name: My Workflow
on: [push]
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Border0 action
if: ${{ failure() }}
uses: borderzero/gh-action@v1
with:
token: ${{ secrets.BORDER0_ADMIN_TOKEN }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
timeout-minutes: 15
Add the workflow_dispatch
configuration and the if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }}
condition to the Border0 action. This will allow you to manually trigger the Border0 action when the debug
input is set to true
.
name: My Workflow
on:
push:
workflow_dispatch:
inputs:
debug:
type: boolean
description: Manually trigger debugging mode with Border0 for the GitHub workflow run
required: false
default: false
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Border0 action
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }}
uses: borderzero/gh-action@v1
with:
token: ${{ secrets.BORDER0_ADMIN_TOKEN }}
timeout-minutes: 15