Created
March 9, 2022 10:33
-
-
Save patrickposner/b6b0060e9798fed9c35dfd6cd1b8ee16 to your computer and use it in GitHub Desktop.
Simply Static - GitHub send Webhook with Authentication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'ssp_webhook_args', function( $args ) { | |
// Get access token. | |
$options = get_option( 'simply-static' ); | |
$acccess_token = $options['github-personal-access-token']; | |
// Modify arguments for POST request. | |
$args = array( | |
'headers' => array( | |
'Authorization' => 'token ' . $access_token, | |
'Accept' => 'application/json', | |
), | |
); | |
return $args; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment