Documentation

Looking for something in particular?

Automation V3: Remote Trigger in GitHub Actions

Steps to Trigger Remote Workflows in GitHub Actions

Step 1: Generate a new token.

Click on the AvatarSettings > Developer Settings > Personal access tokens. Both fine-grained & classic tokens will work for this trigger.

Click Generate new token.

In the Note field, provide the token name. In Select scopes, select the check box for the scope as per the requirement. 

Classic Token: At minimum, the scopes must include full repo access if you used the classic token interface.

Fine-grained Token: The access must include the repository you are triggering the workflow/job on.

Click Generate Token. This will generate an authentication token. Copy it.

Step 2: Add a trigger for the “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.

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

JSON Body:
{

   “event_type”: “my_event_type”

 }

Accept: */*

Content-Type: application/json

Authorization: Bearer {personal_access_token}

Here is an example of a successful request sent via Postman:

You should receive a “204 No Content” response back from the GitHub API.

Step 3: Create a Rest Web  Service Connection in Provar Automation.

Option 1:

Navigate to Settings->Generic Web Service Connections->Create a REST Web Service Connection

Option 2: Navigate to Settings->’+’->Add a Generic Web Service connection->Rest Web Service connection

Then configure the connection settings like so, leaving the authentication as No Authentication.*

*Note: You can also leave the custom header blank and pass the Authorization header in the request header section of the Web Request directly.

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

Step 5: Configure the Resource URL, Request Header, Method, Body Style, and Body as given below.

Note: As mentioned above, you can add the request headers either to the connection settings or to your Web Request (REST) method steps directly.

You would update the Request Header as follows:

Step 6: Drag and drop an Assert step to validate the GitHub API response.

You can configure the step to assert that {RestResponseStatus.StatusCode} = 204 as a basic validation.

Step 7: Run the test case to trigger the GitHub Workflow.

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


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

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