Digital Syriac Corpus

Srophé Application : Documentation

GitHub webhooks

The Srophe application provides a script for syncing both data and code repositories to your GitHub repository, making it easier for distributed contributions to be pushed to the website as they are made on GitHub.

Requirements

github-xq library module: https://github.com/eXist-db/github-xq

Use of script

Edit modules/git-sync.xql to add details for your application and your GitHub repository. (Do not save these details to a GitHub repository)

githubxq:execute-webhook($data as item()*, 
    $application-path as xs:string, 
    $repo as xs:string, 
    $branch as xs:string?, 
    $key as xs:string, 
    $rateLimitToken as xs:string?)

Parameters:

Example:

let $data := request:get-data()
return 
    githubxq:execute-webhook($data, 
        '/db/apps/ba-data',  
        'https://github.com/wsalesky/blogs/', 
        'OPTIONAL-BRANCH', 
        'YOUR-SECRET-KEYE', 
        'OPTIONAL-RATE-LIMIT-KEY')

Note: The XQuery responding to GitHub must be run with elevated privileges in order to save and edit the files in your application.

Example: sm:chmod(xs:anyURI(xs:anyURI('YOUR-ENDPOINT.xql'), "rwsr-xr-x"))

Set up GitHub webhooks

Read about webhooks here: [https://developer.github.com/webhooks/]

Webhook settings: