Remote Trigger in GitHub Actions

You can use a webhook event called repository_dispatch when you want to remote trigger the workflow from any external applications in Github Actions. Please refer Repository Dispatch Event for more information. 

A repository dispatch is an HTTP request to your repository asking GitHub to trigger the workflow remotely.

Steps to Trigger Remote Workflows in GitHub Actions

Step 1: Generate a new token.

Click on the AvatarSettings > Developer Settings > Personal access tokens.

Click Generate new token.

generate a new token to trigger remote workflows in GitHub actions

In the Note field, provide the token name. In Select scopes, select the check box for scope as per the requirement. Click Generate Token. This will generate an authentication token. Copy it.

Provide a token name an select check box for scope as per the requirement

Step 2: Add a trigger for “On” key.

You need to add a trigger for the “On” key so that the workflow will accept repository dispatches. Mention specific event types that will trigger the workflow.

Add a trigger for “On” key to remotely trigger Github actions

You must POST the request to https://api.github.com/repos/:owner/:repo/dispatches to trigger workflows that are set up to accept the dispatch. The payload of a repository dispatch is given below.

{
    "event_type": "my_event_type"
    }

Accept:  application/vnd.github.everest-preview+json
Content-Type: application/json
Authorization: Bearer {{personal_access_token}}

Steps on How to Trigger the Remote Workflow using Provar

1. Create a Rest Web  Service Connection. this image shows initial step on how to trigger the workflow via Provar

2. Create a test case with the connection created above and drag and drop Web Request(REST) method from the Test Palette to the test case.

3. Configure the Resource URL, Request Header, Method, Body Style and Body as given below.

Configure the Resource URL, Request Header, Method, Body Style and Body in Provar

4. Give a bearer token which is the personal access token generated in the repository.

Step 3: See the workflow triggered.

Run the test case. You will get a 204 No Content Response. You can see the workflow triggered under actions.

You will get a 204 No Content Response when workflow is triggered using Provar

workflow status after running the test case to see remote trigger in Github is working

 

Review Provar on G2
Documentation library

Other available resources

Looking for something different?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top