Filter uncanny-automator-pro

automator_github_pro_webhook_event_actions

Filter GitHub webhook event type actions. Filters the actions available for GitHub webhook events to customize or add options.

add_filter( 'automator_github_pro_webhook_event_actions', $callback, 10, 1 );

Description

Fires when Uncanny Automator Pro is preparing the list of available GitHub webhook event type actions for selection. Developers can use this filter to add, remove, or modify the event types available in the GitHub integration's triggers. The `$actions` parameter is an array of arrays, where each inner array contains 'text' and 'value' keys for display and programmatic use.


Usage

add_filter( 'automator_github_pro_webhook_event_actions', 'your_function_name', 10, 1 );

Parameters

$actions (array)
@property text - The text to display for the event. @property value - The value to use for the event.

Return Value

array


Examples

/**
 * Example of adding a custom GitHub webhook event action.
 * This example adds a new action for when a pull request is opened.
 */
add_filter( 'automator_github_pro_webhook_event_actions', function( $actions, $event ) {
	// Check if the current event is related to pull requests.
	if ( 'pull_request' === $event ) {
		// Add a new action for when a pull request is opened.
		$actions[] = array(
			'text'  => esc_html_x( 'Pull Request Opened', 'GitHub', 'uncanny-automator-pro' ),
			'value' => 'opened',
		);
	}
	// Always return the modified actions array.
	return $actions;
}, 10, 2 );

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

uncanny-automator-pro/src/integrations/github/helpers/github-app-helpers.php:278

*             'value' => 'completed',
		 *         );
		 *     }
		 *     return $actions;
		 * }, 10, 2 );
		 * } );
		 */
		return apply_filters( 'automator_github_pro_webhook_event_actions', $actions, $event );
	}
}

Internal Usage

Found in uncanny-automator-pro/src/integrations/github/helpers/github-app-helpers.php:267:

* add_filter( 'automator_github_pro_webhook_event_actions', function( $actions, $event ) {
Scroll to Top