5X - Setting Up GitHub Merge-Triggered Workflows Using 5X Webhooks

This guide explains how to configure your GitHub repository to automatically trigger 5X workflows/jobs when code is merged into the main branch or other specific branches.

Overview

5X workflows can be triggered via webhooks, allowing seamless integration with GitHub events. When a webhook-triggered job is created in 5X, you'll receive a webhook URL and an access token that can be configured in your GitHub repository settings.
Note: Currently, each workflow can have only one trigger type (excluding manual triggers, which are always available). Additionally, the trigger type for a job cannot be currently edited once the job has been created. Support for multiple triggers per workflow as well as the ability to edit the trigger type for a job once created is coming soon.

Step-by-Step Configuration

1. Create a Webhook-Triggered Job in 5X

Navigate to the Jobs section in your 5X workspace
Create a new job
In the trigger configuration, select "Webhook" as the trigger type.
Add additional nodes as relevant to the job.
Save the job
Once the job is saved, copy the provided webhook URL and access token - you'll need these for GitHub setup

Setting Up GitHub Merge-Triggered Workflows Using 5X Webhooks

This guide explains how to configure your GitHub repository to automatically trigger 5X workflows when code is merged into the main branch.

Overview

5X workflows can be triggered via webhooks, allowing seamless integration with GitHub events. When a webhook-triggered job is created in 5X, you'll receive a webhook URL and an access token that will be used in GitHub Actions to trigger your workflows.
Note: Currently, each workflow can have only one trigger type (excluding manual triggers, which are always available). Support for multiple triggers per workflow is coming soon.

Step-by-Step Configuration

1. Create a Webhook-Triggered Job in 5X

Navigate to the Orchestration section in your 5X workspace
Create a new job or edit an existing one
In the trigger configuration, select "Webhook Trigger"
Save the job
Copy the provided webhook URL and access token - you'll need these for GitHub Actions setup

2. Set Up GitHub Actions Workflow

Create a new GitHub Actions workflow file at .github/workflows/trigger-5X-job.yml:
name: Trigger 5X Workflow

on:
pull_request:
types: [closed]
branches:
- main

jobs:
trigger-5x:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Trigger 5X Webhook
run: |
curl -X POST \
-H "Authorization: ${{ secrets.FIVEX_WEBHOOK_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"event": "merge_to_main", "repository": "${{ github.repository }}"}' \
${{ secrets.FIVEX_WEBHOOK_URL }}

3. Set Up GitHub Secrets

In your GitHub repository, go to Settings → Secrets and variables → Actions
Add two new Repository secrets:
Name: FIVEX_WEBHOOK_URL Value: Your 5X webhook URL that was copied when the job was saved
Name: FIVEX_WEBHOOK_TOKEN Value: Your 5X access token that was copied when the job was saved

Verification

To verify your setup:
Create a pull request to your main branch
Merge the pull request
Check the GitHub Actions tab to confirm that an action was triggered
Verify in 5X that your job started executing

Troubleshooting

Verify the access token and webhook URL are properly set in GitHub secrets
Check GitHub Actions logs for any curl command errors
Confirm the workflow is properly configured in 5X to accept webhook triggers
For additional support, contact 5X support team support@5x.co.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.